Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

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

open
None
5
2005-01-06
2003-04-17
Jérôme Schell
No

(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.

Jérôme

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

Discussion

  • Rainer Link
    Rainer Link
    2003-04-19

    • assigned_to: nobody --> bengen
    • summary: Problem with amavis-ng and "From: <>" --> Problem with amavis-ng and "From: <>"
     
  • Logged In: YES
    user_id=139563

    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...

     
  • Logged In: YES
    user_id=909826

    Hi,
    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);

    to

    $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
    user_id=992290

    >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.

    Uli

     
  • Tony Howden
    Tony Howden
    2004-07-28

    Logged In: YES
    user_id=568376

    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 <>.

    $$args{'sender'}='<>';
    becomes
    $$args{'sender'}='';

    and that should fix it.
    cheers
    Tony

     
  • Hilko Bengen
    Hilko Bengen
    2005-01-06

    • assigned_to: bengen --> braeucup