Aleksandr,
> I have mail server running Sun Solaris 10 with postfix-2.4.6 mta in one
> zone and amavisd-new-2.5.2 in another one. They are communicating via
> TCP. amavisd-new processes ~15000 messages a day.
> I'm running this setup for some time and it seems quiet stable. However,
> strange error periodically occurs. When mta is done submitting message
> to amavisd and says "QUIT" sometimes it responds with error message "Bad
> SMTP code".
>
> I've traced down this problem and found that error occurs in rw_loop
> function. Here is excerpt from amavisd log (log level 5):
>[...]
> rw_loop: needline=1, flush=0, wr=0, timeout=293
> rw_loop: receiving (!)rw_loop read failed: Resource temporarily unavailable
> smtp resp to data-dot (<[EMAIL PROTECTED]>):
> Negative SMTP resp. to data-dot (<[EMAIL PROTECTED]>):
Thanks for a detailed problem report.
The EAGAIN status despite a read-ready flag set by a 'select' seems to be
Solaris specific, which probably explains why this problem hasn't been
reported yet.
Please try the following patch against 2.5.3 (probably applies to 2.5.2 too).
--- amavisd.orig 2008-01-28 20:29:31.000000000 +0100
+++ amavisd 2008-02-12 01:15:31.000000000 +0100
@@ -14400,7 +14400,12 @@
my($nread) = sysread($sock,$inbuf,32768);
if (!defined($nread)) {
- do_log(-1,"rw_loop read failed: %s", $!);
- $!==0 || $!==EAGAIN || $!==EINTR
- or die "Error receiving from socket: $!";
+ if ($!==0 || $!==EINTR || $!==EAGAIN) {
+ do_log($!==EAGAIN?2:0, "rw_loop read failed: %s", $!);
+ $idle_cnt = 0;
+ } else {
+ do_log(-1,"rw_loop read failed: %s", $!);
+ $self->{inpeof} = 1;
+ die "Error receiving from socket: $!";
+ }
} elsif ($nread < 1) { # sysread returns 0 at eof
$self->{inpeof} = 1; do_log(3,"rw_loop read: got eof");
@@ -14434,5 +14439,8 @@
(!$flushoutput || $self->{out} eq '');
last if $self->{inpeof};
- last if $idle_cnt > 0; # probably exceeded timeout
+ if ($idle_cnt > 0) { # probably exceeded timeout
+ do_log(-1,"rw_loop: leaving rw loop, no progress");
+ last;
+ }
$failed_write_attempts < 100 or die "rw_loop: Aborting stalled sending";
}
Mark
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/