From: Steffen Nurpmeso Subject: Re: smtpd: allow escaping inside quotes To: Omar Polo Cc: tech@openbsd.org, Martijn van Duren Date: Tue, 23 Jan 2024 00:00:52 +0100 Dear Omar Polo, Omar Polo wrote in <248HEPT7PIWVZ.2QV59XPHQ4YWJ@venera>: |A bug was filed for opensmtpd-portable regarding escape sequences inside |quotes in headers: . | |The issue is easily replicable by sending a mail with a from as follows: | | From: "\"Doe, John\"" ... I am currently writing a RFC 5322 parser (for a simple DKIM signer that i am about to write until February 1st due to Google, if that works out, sigh), and have found out that most such parsers are pretty bad. I Cc:d martijn@ because i saw his DKIM module which also includes a RFC 5322 parser. 'Seems to me it might be ok because OpenSMTPD seems to do things like %s@%s when generating addresses, but i have not looked deeper. Please see below some test cases to try out. Note some come from the RFC 822, 5322 standard (drafts). I could imagine OpenSMTPD to fail for some, martijn's thing does for sure. My parser is nearly finished and very coooooool, even more tests there are, but i am still working on that. John Doe - John Doe - John Doe - John Doe - John Doe - Mary Smith - Joe Q. Public - Mary Smith <@node.test:mary@example.net> - jdoe@test . example - Pete(A nice \) chap) - Chris Jones - John (my (dear (friend))) - "Mary Smith: Personal Account" - "Joe Q. Public" - "Giant; \"Big\" Box" - - John Doe <@dsda.e,@mda.je:jdoe@machine.example> - Mary Smith , jdoe@example.org, Who? -- , "Giant; \"Big\" Box" -- A Group:Ed Jones ,joe@where.test,John ; -- Undisclosed recipients:; -- A Group(Some people) :Chris Jones , :Chris Jones2 , joe@example.org, John (my dear friend); (the end of the group) -- (Empty list)(start)Hidden recipients :(nobody(that I know)) ; -- user@example.com - "Full Name" - spam@spammer.com - God@heaven <@hop1.org,@hop2.net:jeff@spec.org> - Real Name ((comment)) ' - ho.(hi)ha@x.y - (bo) ho.(hi)ha@x.y - a@malicious.org@important.com - --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)