From: short <> Date: Sun, 22 May 2005 03:31:55 +0000 (+0000) Subject: Sanity check crashing spamassassin(1). X-Git-Url: http://git.jankratochvil.net/?p=PerlMail.git;a=commitdiff_plain;h=33153507e6b498c5f7c6d653bb494661fa7438a3 Sanity check crashing spamassassin(1). --- diff --git a/perlmail-accept b/perlmail-accept index 3432acb..f2e12ec 100755 --- a/perlmail-accept +++ b/perlmail-accept @@ -498,11 +498,13 @@ sub _spamchildcode my($err,$isspam)=@_; $err=$? if !defined $err; - return undef() if !WIFEXITED($?); - return undef() if WIFSIGNALED($?); - return undef() if WIFSTOPPED($?); - return $isspam||1 if WEXITSTATUS($?); # is-spam - return 0; # not-spam + return undef() if !WIFEXITED($?); + return undef() if WIFSIGNALED($?); + return undef() if WIFSTOPPED($?); + return 0 if !WEXITSTATUS($?); + return $isspam||1 if 1==WEXITSTATUS($?); # isspam + cluck "Possible FIXME or your system is broken (WEXITSTATUS==".WEXITSTATUS($?).")"; + return 0; # simulate as not spam } # return: true (error-message or "1") if is spam @@ -510,8 +512,9 @@ sub spamassassin { my($cmd)=@_; - $cmd||="$HOME/bin/spamassassin --exit-code"; - # spamassassin has exit code 1 if IS spam, code 0 if NOT spam + $cmd||="$HOME/bin/spamassassin --exit-code 1"; + # spamassassin has the specified exit code if IS spam, code 0 if NOT spam + # See &_spamchildcode for the code 1. local *CHILD; local $SIG{"PIPE"}=sub { warn "spamassassin gave me SIGPIPE: broken pipe"; }; # prevent Razor2's: Can't call method "log" on unblessed reference at Razor2/Client/Agent.pm line 212.