#302 Problem with amavis-ng and "From: <>"


(I post it there after the forum cause nobody seems to
have seen that)

I use amavis-ng with SMTP mode.
When a message comes with a "MAIL FROM: <>" (empty mail
address) the sender is set to "<<>>".
This is due to the Net::SMTP::_addr function.
After the scan is over, when resending mail to MTA,
this address is passed again to Net::SMTP::_addr
function (in Net::SMTP::mail) and is returned as "<<>".
This is an invalid address so the MTA reject it and
amavis-ng put the message in the problem directory.
I solve that by modifying AMAVIS/MTA/SMTP.pm like this:

@@ -618,7 +618,7 @@

$$args{'sender'} = $from;
- $$args{'sender'} = "<>" if (!$$args{'sender'});
+ $$args{'sender'} = "<>" if (!$$args{'sender'} ||
$$args{'sender'} =~ /<+>+/);
push @{$$args{'recipients'}}, @to;
return 1;

This is probably an horrible hack.
Tell me what you think about that.


PS: my version of libnet-perl is 1.09.01 (Debian Woody)
and I use postfix as the MTA


  • Rainer Link

    Rainer Link - 2003-04-19
    • assigned_to: nobody --> bengen
    • summary: Problem with amavis-ng and "From: <>" --> Problem with amavis-ng and "From: <>"
  • Bozhan Boiadzhiev

    Logged In: YES

    i am using amavis-0.3.12 with debian and i have
    same problem which i solve removing coment form this
    row in amavis/mta/qmail_send
    # $SENDER = &quot;&quot; if $SENDER eq &quot;&lt;&gt;&quot;;

    i hope there isn't other problem with that but
    as i understand it will set $SENDER to be empty (&quot;&quot;) when is
    equal to &lt;&gt;
    which is exactly what qmail wants i think...

  • Mathieu MALAISE

    Mathieu MALAISE - 2003-11-15

    Logged In: YES

    I've the same problem with Amavis 0.3.12 and qmail 1.0.3 as MTA.
    It modifies the Return-Path header from &lt;&gt; to &lt;&quot;&lt;&gt;&quot;&gt;, and
    causes the message to bounce forever.
    I temporarly solved the problem by changing line #425 of the
    amavis file from :

    $SENDER = &quot;&lt;&gt;&quot; if (!$SENDER);


    $SENDER = '' if (!$SENDER);

    &lt;&gt; is valid and is mandatory as value for the Return-Path
    header in bounce messages (RFC821/2821)...

  • Uli Wurst

    Uli Wurst - 2004-03-07

    Logged In: YES

    >I solve that by modifying AMAVIS/MTA/SMTP.pm like this:
    >@@ -618,7 +618,7 @@
    >$$args{'sender'} = $from;
    >- $$args{'sender'} = "<>" if (!$$args{'sender'});
    >+ $$args{'sender'} = "<>" if (!$$args{'sender'} ||
    >$$args{'sender'} =~ /<+>+/);
    >push @{$$args{'recipients'}}, @to;
    >return 1;

    That seems to do nothing, shouldn't this rather read like this?

    $$args{'sender'} = "" if (!$$args{'sender'} ||
    $$args{'sender'} =~ /<+>+/);

    That appears to solve the issue for me.


  • Tony Howden

    Tony Howden - 2004-07-28

    Logged In: YES

    Hi All

    Same issue with the qmail script in Amavis-ng 1.6. Amavis,
    if it finds a null sender (return-path) then it forces the
    sender to be <> which is then wrapped inside the default <"
    "> to give <"<>"> which is invalid.

    For Qmail edit line 135 of Qmail.pm to remove the <>.


    and that should fix it.

  • Anonymous - 2005-01-06
    • assigned_to: bengen --> braeucup

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks