Syntax error in MAIL FROM parameters

Dauser Martin Johannes mdauser at cs.sbg.ac.at
Sat Feb 17 23:31:51 CET 2018


On Sat, 2018-02-17 at 16:38 +0100, Christian Boltz wrote:
> Hello,
> 
> does someone know what Amavis wants to tell me with this message, and
> how to avoid these rejects?
> (the mail address is anonymized starting at "user=")
> 
> Feb 15 12:38:28 server amavis[3273]: (03273-17) ESMTP: 501 5.5.4
> Syntax error in MAIL FROM parameters; smtp_resp: MAIL FROM:<bounce+28
> f75a.232d6-user=example.com at mail.example2.com> BODY=8BITMIME
> SMTPUTF8\r\n
> 


> Looking at the amavis source code in /usr/sbin/amavisd shows
> (starting at line 20555)
> 
>         my($addr,$opt) = ($1,$2);  my($size,$dsn_ret,$dsn_envid);
>         my $msg ; my $msg_nopenalize = 0;
>         for (split(' ',$opt)) {
>           if (!/^ ( [A-Za-z0-9] [A-Za-z0-9-]*  ) =
>                   ( [\041-\074\076-\176]+ ) \z/xs) { # printable, not
> '=' or SP
>             $msg = "501 5.5.4 Syntax error in MAIL FROM parameters";
>           } else {
> 
> as likely source of the problem - at least, that's the only place
> where
> I found the error message.
> 
> Does someone know how I can avoid those rejects?
> 
> 
> Regards,
> 
> Christian Boltz

As this seems to be the only occurrence, it's most likely the relevant
code.

I tried to phrase the main part of this if-clause's condition in a
sentence. I included the round brackets of the code.

If (not starting ( with an alphanumeric sign, followed by none or any
amount of alphanumeric signs, including '-'), followed by '=' ,(
followed by at least on alphanumeric sign, including sings like '!',
'[', '.' and so on, except for '=' and empty space) \z/xs)

then message $msg becomes "501 5.5.4 Syntax error in MAIL FROM
parameters"

Your
<bounce+28f75a.232d6-user=example.com at mail.example2.com>

includes a '<', a '+' and a '.' before '=' which isn't allowed by this
if-clause. But beforehand the code splits some $opt in substrings
(separator is one empty space), so I'm not 100% sure what this if-
clause is looking at.

I hope this helps a bit.
Martin Johannes Dauser


More information about the amavis-users mailing list