Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bad sender address syntax ..

941 views
Skip to first unread message

Amedeo Rinaldo

unread,
Jul 12, 2012, 12:13:01 PM7/12/12
to

Weird 'Bad sender address syntax', where '""@' come from ? some ideas?
(see info below)

--
.''`. *Amedeo Rinaldo*
: :' : debian addicted ;-)
`. `'
`-

-------------------


OS: Debian squeeze (2.6.32-5-amd64)
Amavis: debian 2.7.0-1~bpo60+1 (amavisd-new-2.7.0 '20110701')
Postfix: debian 2.9.1-2~bpo60+1

(real data masked)

## mailq

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
4082940175 4252 Wed Jul 11 09:16:46 ""@externaldomain.tld
(host 127.0.0.1[127.0.0.1] said: 451 4.5.0 Error in processing,
id=01823-04, quar+notif FAILED: Can't quarantine: 501 5.1.7 from
MTA(smtp:[127.0.0.1]:10025): 501 5.1.7 Bad sender address syntax at
/usr/sbin/amavisd-new line 14443. (in reply to end of DATA command))
reci...@mydomain.tld
-- 4 Kbytes in 1 Request.


## mail.log snip
..
Jul 11 09:16:46 mx20 postfwd2/policy[8975]: [RULES] rule=3, id=WL_003,
client=smtp.externaldomain.tld[111.222.333.444],
sender=<@externaldomain.tld>, recipient=<reci...@mydomain.tld>,
helo=<smtp.externaldomain.tld>, proto=ESMTP, state=RCPT, delay=0.00s,
hits=WL_003, action=DUNNO
Jul 11 09:16:46 mx20 postfix/qmgr[4250]: 4082940175:
from=<@externaldomain.tld>, size=4252, nrcpt=1 (queue active)
Jul 11 09:16:47 mx20 re-injection/smtpd[11314]: warning: Illegal address
syntax from localhost[127.0.0.1] in MAIL command: <""@externaldomain.tld>
Jul 11 09:16:47 mx20 amavis[11835]: (11835-17) (!)SEND from
<""@externaldomain.tld> -> <quara...@localsystem.tld>,BODY=7BIT 501
5.1.7 from MTA(smtp:[127.0.0.1]:10025): 501 5.1.7 Bad sender address syntax
Jul 11 09:26:29 mx20 postfix/qmgr[4250]: 4082940175:
from=<@externaldomain.tld>, size=4252, nrcpt=1 (queue active)
Jul 11 09:26:30 mx20 re-injection/smtpd[11722]: warning: Illegal address
syntax from localhost[127.0.0.1] in MAIL command: <""@externaldomain.tld>
Jul 11 09:26:30 mx20 amavis[12339]: (12339-14) (!)SEND from
<""@externaldomain.tld> -> <quara...@localsystem.tld>,BODY=7BIT 501
5.1.7 from MTA(smtp:[127.0.0.1]:10025): 501 5.1.7 Bad sender address syntax

baj...@gmail.com

unread,
Jul 12, 2012, 5:50:00 PM7/12/12
to
Il 12/07/2012 18:13, Amedeo Rinaldo ha scritto:
>..[CUT]..
> ## mail.log snip
> ..
> Jul 11 09:16:46 mx20 postfix/qmgr[4250]: 4082940175: from=<@externaldomain.tld>, size=4252, nrcpt=1 (queue active)
> ..


Ok.. I've investigated a little and it come out that my postfix is
accepting email addresses with an empty local-part.
The postfix 'strict_rfc821_envelopes' configuration parameter handles
also this behaviour.. (default: disabled).
Amavis don't love it too much ( ""@domain.tld ) and "gracefully" stuck
.. with a probable DoS risk.

So, my fault.. I wasn't aware of this requirement
(strict_rfc821_envelopes=yes).

Ciao

Mark Martinec

unread,
Jul 16, 2012, 8:31:54 AM7/16/12
to
Amedeo,

> Weird 'Bad sender address syntax', where '""@' come from ? some
> ideas? (see info below)

> Ok.. I've investigated a little and it come out that my postfix is
> accepting email addresses with an empty local-part.
> The postfix 'strict_rfc821_envelopes' configuration parameter handles
> also this behaviour.. (default: disabled).
> Amavis don't love it too much ( ""@domain.tld ) and "gracefully" stuck
> .. with a probable DoS risk.
>
> So, my fault.. I wasn't aware of this requirement
> (strict_rfc821_envelopes=yes).

It's a case of 'garbage-in/garbage-out'. Neither a null local part
nor a "" are valid, but Postfix chose to mercifully permit the
first but not the second, unless strict_rfc821_envelopes=yes.

RFC 5322 requires quoting of a local part which is not following
a dot-atom syntax, which is what amavisd did, at least until
version 2.4.0:


amavisd-new-2.4.0 release notes

- no longer bother to convert addresses like <""@yahoo.com> to <@yahoo.com>,
both forms are invalid anyway, and recent versions of Postfix treat them
the same. It is probably a good idea to set strict_rfc821_envelopes=yes
in main.cf to reject such non-replyable sender addresses straight away,
otherwise we end up processing such mail with inability to bounce it when
needed, effectively losing it;


Mark

0 new messages