Improperly Quoted Addresses

The syntax rules for e-mail addresses are fairly complex and some software either does&#x27;t handle all the cases correctly or has bugs in handling some obscure cases.

One specific case that comes up from time to time is where a pair of superfluous single or double quotes ends up around an entire address, e.g., &#x27;user@host&#x27; "user@host" Both of these are fairly problematic, for different reasons.

The first of these is actually syntactically valid - single quotes are treated as ordinary characters in both the local and domain parts of addresses. But this means that the address has a local part of  and a domain part of   and that is unlikely to be what was intended, if for no other reason than   cannot be a valid domain name in the DNS.

The syntactic validity of the first address it actually something of a problem because no heuristics are ever applied to syntactically valid addresses. So the address is successfully parsed but is then likely to be rejected by the subsequent rewriting process. And even if it isn&#x27;t rejected the quotes will still be present and will inevitably cause the address to be rejected at some point.

One possible workaround is to use the address rewriting facilities to remove the superfluous single quotes. This can be done with a rewrite rule $&#x2a;         $E$F${QUOTE_CHECK,$U$@$H} that calls a mapping: QUOTE_CHECK &#x27;&#x2a;@&#x2a;&#x27;           $Y$0%$1 The surrounding double quotes make the second address a valid local part. However, a local part by itself is not a valid address - a domain must also be present. And while the MTA applies various fixups to try and make syntactic invalid addresses valid, in this particular case the heuristics get confused by the presence of the @ and don&#x27;t try adding a default domain. The heuristics have been altered in the 7.0-0 version of Messaging Server to try adding a default domain.