On Sat, Apr 05, 2014 at 03:50:40PM +0100, Andy Bennett wrote: > [email protected] > Andy Bennett <[email protected]> > "Andy Bennett"@example.net > "Andy\ Bennett"@example.net > > My trouble starts with the last two examples above. RFC 822 talks about > local-parts being "uninterpreted" however, their parser specification in > section-3 would decode the last two encodings to the same local-part.
Correct, uninterpreted by everything except the system receiving email for the named mailbox. > When reencoding it, am I allowed to generate either encoding? Yes, but you should emit addresses without unnecessary quoted strings or quoted pairs, sot the first one (without the backslash) is preferred. > In other parts of RFC 822 (http://tools.ietf.org/html/rfc822#section-6.2 > ) they talk about "uninterpreted" parts of the domain and I'm pretty > sure that "canonicalisation" of the domain part is allowed. RFC 822 was superceded by RFC 2822 and in turn 5322. Canonicalizing the domain is no longer allowed except at the receiving system. > So, do I just have to preserve case in local-parts or do I have to > preserve the encoding in its entirety? You can and should remove unnecessary backslashes in quoted strings where the subsequent character is not a backslash or double-quote. You can and should de-quote the localpart when the contents of the quoted string are a valid dot-atom, per the grammar of RFC 5322: "foo.\bar"@example.com -> "foo.bar"@example.com -> [email protected] You should also quote invalid local parts that are not dot-atoms: [email protected] -> "foo..bar"@example.com foo:[email protected] -> "foo:bar"@example.com ... Of course one should also avoid creating mailboxes whose local-parts require quoting, that is just asking for all sorts of pain. -- Viktor. -- ## List details at https://lists.exim.org/mailman/listinfo/exim-users ## Exim details at http://www.exim.org/ ## Please use the Wiki with this list - http://wiki.exim.org/
