#353 Several amavis-ng SMTP.pm errors

open
None
5
2005-01-06
2004-06-07
Kerem ERSOY
No

Hi,

I am using amavis-ng-0.1.6.4-orig.

There are several problems with SMTP.pm. The first one
is when called from the MTA program SMTP.pm closes
connection right after MAIL FROM: and logging nothing
to the log. I noticedthat the problem here is:

/^MAIL FROM:(.*)$/i && do {
$from=Net::SMTP::_addr($1);
@to=();
$conn->print("250 Ok.\r\n");
next;
};
/^RCPT TO:(.*)$/i && do {
if (defined $from) {
push @to,Net::SMTP::_addr($1);
$conn->print("250 Ok.\r\n");
}
else {
$conn->print("503 Who are you?\r\n");
}
next;
};

$from=Net::SMTP::_addr($1);

_addr procedure causes an error. I noticed that is only
correctly quoting the recipient and sender name so I
modified it:

$from=$1;

I think the name should already be in correct form. I am
not sure if some error happens because off white spaces
aroun d the "<adress>" ??

Another problem is:
accept_message. In my system I do a lot of
redirections. So when my MTA gets the initial message I
don't check if a user is really existing. But I check it
when I get the scanned message. So if a mail is sent to
a non existing message this routine gets a 550 error
stating the user is not exist. But accept_message does
no error checking so it simply closes the connection
again *without loging* anything all I get in logs is:
Jun 7 06:38:24 moose amavis[16480]: AMAVIS:
Determined 00000001 to be type text/plain
Jun 7 06:38:24 moose amavis[16480]: Not attempting
to unpack 00000001
Jun 7 06:38:24 moose amavis[16480]:
AMAVIS::AV::CLAMD: No virusses found
Jun 7 06:38:24 moose amavis[16480]:
AMAVIS::MTA::SMTP: Accepting message - SMTP.pm
localhost:10026.
Jun 7 06:38:24 moose amavis[16480]: Setting sender:
<nury@arkorg.com>
Jun 7 06:38:24 moose amavis[16480]: Setting
recipients: <adnan@moose.sibernet.com.tr>
^^^
This is a non existing user... Not rejected in initial
contact with MTA
Jun 7 06:38:24 moose amavis[16480]: AMAVIS: Error
while accepting message
^^^^^^
This is because accept mesage got a 550 Error after
RCPT TO: but has no means to report it back..

Jun 7 06:38:24 moose amavis[16480]:
AMAVIS::MTA::SMTP: Freezing message
Jun 7 06:38:24 moose amavis[16480]: Quarantining
infected message to /var/spool/amavis-
ng/problems/40c3e330-4060

# Called from within AMAVIS.pm to continue message
delivery
sub accept_message( $ ) {
my $self = shift;
my $args = shift;

writelog($args,LOG_INFO, __PACKAGE__.": Accepting
message - SMTP.pm
$cfg_smtp_out:$cfg_smtp_port_out.");
$mta_result='accept';

# Send message out via SMTP.
my $smtpclient = new Net::SMTP
("$cfg_smtp_out:$cfg_smtp_port_out",
Hello => 'localhost',
Timeout => 30) || do {
writelog($args,LOG_ERR, __PACKAGE__.
": Unable to connect to SMTP server on
$cfg_smtp_out:$cfg_smtp_port_out.");
return 0;
};

I ma not very good at PERL so unfortunately I cant give
a hand for fixing these errors for the time being.

Best Regards,
Kerem ERSOY

Discussion

  • Lars Hecking
    Lars Hecking
    2005-01-05

    • assigned_to: nobody --> bengen
     
  • Hilko Bengen
    Hilko Bengen
    2005-01-06

    • assigned_to: bengen --> braeucup