Running Exim 4.80 here on CentOS 6.x as a general-purpose ISP MTA for a
bunch of virtual users. Most of them use smtps and/or STARTTLS.
Occasionally, I'm seeing messages get stuck in queue because the
submitting client program appears to be sending the envelope FROM
address enclosed in double-quotes, such as: <"username@???">.
The resulting message gets injected into the queue with the system's
default domain appended, almost as if it's treating the FROM address as
username-only and "requalifying" it with the default domain:
(from queue header file - "example.net" is an arbitrary client host,
example.org is the user's virtual-hosted domain, and ispmail.example.com
is our mailhost)
251P Received: from client-xxxx.example.net ([xxx.xxx.180.178]
helo=example.org)
by ispmail.example.com with esmtpa (Exim 4.80)
(envelope-from <"username@???>)
id 1V0VOo-0001p3-9J; Sat, 20 Jul 2013 04:32:30 -0700
This is causing remote receiving hosts to reject the message during
relaying attempts, with errors such as:
>>> 501 #5.1.3 Invalid character ('@') in username.
and
>>> 501 #5.5.2 syntax error 'MAIL
FROM:<"username@???> SIZE=2850'
Is there a way to display a meaningful error to the client when Exim
sees a username with the offending pattern, similar to the first 501
error shown above, or, "501 #5.1.3 Sender FROM address is malformed or
has extraneous quotes"? Simply relying on setting
sender_unqualified_hosts wouldn't be ideal because the error it shows to
the client is too generic. I'd ideally like the client to see an error
message that specifically explains that using double quotes in the From
address is not permitted.
Is there ever a time when double quotes are actually needed for the
local portion of an envelope FROM address?