Jorgen, > Amavisd-2.5.3 > Solaris 10 10/08 > perl-5.8.4 > > We currently have the situation where a mail that will go over the > "Exceeded storage quota" limit, will be retried forever. It also seems > to be the case that all (even tiny mail) following will trigger the same > error. But I will deal only with the first case here. > > On the test-vmx server, with no other email flowing, I can send it an > email, with a small gzip file, that tries to expand to 1G. This will > trigger the "Exceeded storage quota", but also get "stuck". > [...] > this ends up in "do_uncompress" function. This also has an "eval" block > to execute > [2] "run_command". This will call "die(Exceeded storage quota)". > > The "or do" part of [2] will catch that exception, and set "$eval_stat" > to "Exceeded storage quota". We will eventually return $retval, which is > now "0". I have confirmed this with oodles of do_log() calls.
You are quite right, the do_uncompress should have propagated the exception. It is a bug. Please try the patch below (agains 2.5.3), it fixes similar cases in other decoders too. > It also seems > to be the case that all (even tiny mail) following will trigger the same > error. But I will deal only with the first case here. This shouldn't be hapening, and I can't reproduce it here. I would appreciate if you could look into the matter. --- amavisd~ 2009-06-24 14:31:51.000000000 +0200 +++ amavisd 2009-06-24 14:30:02.000000000 +0200 @@ -18605,9 +18605,9 @@ $eval_stat = $@ ne '' ? $@ : "errno=$!"; chomp $eval_stat; - if ($eval_stat =~ /^Exceeded storage quota/ || - $eval_stat =~ /^Maximum number of files\b.*\bexceeded/) { - $hold = $eval_stat; - } else { - do_log(-1,"Decoding of %s (%s) failed, leaving it unpacked: %s", - $part->base_name, $part->type_long, $eval_stat); + my($ll) = -1; + if ($eval_stat =~ /\bExceeded storage quota\b.*\bbytes by/ || + $eval_stat =~ /\bMaximum number of files\b.*\bexceeded/) { + $hold = $eval_stat; $ll = 1; } + do_log($ll,"Decoding of %s (%s) failed, leaving it unpacked: %s", + $part->base_name, $part->type_long, $eval_stat); $sts = 2; # keep the original, along with possible decoded files @@ -18930,3 +18930,3 @@ undef $proc_fh; undef $pid; - do_log(-1, "do_uncompress: %s", $eval_stat); + die "do_uncompress: $eval_stat\n"; # propagate failure } @@ -19089,4 +19089,5 @@ undef $proc_fh; undef $pid; - if ($testing_for_sfx) { die "do_7zip: $eval_stat" } - else { do_log(-1, "do_7zip: %s", $eval_stat) }; + # if ($testing_for_sfx) { die "do_7zip: $eval_stat" } + # else { do_log(-1, "do_7zip: %s", $eval_stat) }; + die "do_7zip: $eval_stat\n" # propagate failure } @@ -19226,4 +19227,5 @@ undef $proc_fh; undef $pid; - if ($testing_for_sfx) { die "do_unrar: $eval_stat" } - else { do_log(-1, "do_unrar: %s", $eval_stat) }; + # if ($testing_for_sfx) { die "do_unrar: $eval_stat" } + # else { do_log(-1, "do_unrar: %s", $eval_stat) }; + die "do_unrar: $eval_stat\n" # propagate failure } @@ -19282,10 +19284,16 @@ undef $proc_fh; undef $pid; - if ($testing_for_sfx) { die "do_lha: $eval_stat" } - else { do_log(-1, "do_lha: %s", $eval_stat) }; + # if ($testing_for_sfx) { die "do_lha: $eval_stat" } + # else { do_log(-1, "do_lha: %s", $eval_stat) }; + die "do_lha: $eval_stat\n"; # propagate failure } else { # preliminary archive traversal done, now extract files snmp_count("OpsDecBy\u${decompressor_name}"); - # my($rv) = store_mgr($tempdir, $part, \...@list, $archiver, 'pq', $fn); - my($rv) = store_mgr($tempdir, $part, \...@list, $archiver, 'pq', $fn.".exe"); + my($rv); + eval { + # store_mgr may die, make sure we unlink the .exe file + $rv = store_mgr($tempdir, $part, \...@list, $archiver, 'pq', $fn.".exe"); + 1; + } or do { $eval_stat = $@ ne '' ? $@ : "errno=$!" }; + unlink($fn.".exe") or do_log(-1, "Can't unlink %s.exe: %s", $fn,$!); + if (defined $eval_stat) { die "do_lha: $eval_stat\n" } # propagate failure $rv==0 or die exit_status_str($rv); - unlink($fn.".exe") or die "Can't unlink $fn.exe: $!"; } @@ -19408,2 +19416,3 @@ unlink("$fn.zoo") or die "Can't unlink $fn.zoo: $!"; + if (defined $eval_stat) { die "do_zoo: $eval_stat\n" } # propagate failure $retval; @@ -19503,4 +19512,5 @@ undef $proc_fh; undef $pid; - if ($testing_for_sfx) { die "do_unarj: $eval_stat" } - else { do_log(-1, "do_unarj: %s", $eval_stat) }; + # if ($testing_for_sfx) { die "do_unarj: $eval_stat" } + # else { do_log(-1, "do_unarj: %s", $eval_stat) }; + die "do_unarj: $eval_stat\n" # propagate failure } @@ -19541,2 +19551,3 @@ } + if (defined $eval_stat) { die "do_tnef_ext: $eval_stat\n" } # propagate $retval; @@ -19898,3 +19909,3 @@ undef $proc_fh; undef $pid; - do_log(-1, "store_mgr: %s", $eval_stat); + die "store_mgr: $eval_stat\n"; # propagate failure } Mark ------------------------------------------------------------------------------ _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/