SA Bugzilla – Bug 4930
[review] -e exit code option not working
Last modified: 2006-07-10 09:27:01 UTC
3.1.2 is not setting a non-zero exit code when a message is classified as spam. e.g. spamassassin -e < sample-spam.txt 3.1.1 exit code = 5 3.1.2 exit code = 0
I found the same on SuSE 10.1. The exit code is always 0.
Hrm. This is caused by the fix for bug 3754. Basically we needed to kluge in a return value when files can't be read, etc. Interestingly, the problem seems to be related to a perl "feature". Specifically, it looks like: eval { $exitvalue ||= !$iter->run(@targets); }; the decision to set $exitvalue (ala "||=") is made first (because $exitvalue is undefined), then it's set to the return from run() -- however, the wanted() function (called from run()) sets the global variable, so we get: $exitvalue = undef; # start $exitvalue = 5; # set in wanted() via run() $exitvalue = 1; # set in the eval {} $ perl -e '$t ||= foo(); sub foo { $t = 5; return 1; } print "$t\n"' 1 So, interesting. Patch coming shortly.
Created attachment 3547 [details] suggested patch
wow. +1
+1
Sending spamassassin.raw Transmitting file data . Committed revision 420375.
*** Bug 4977 has been marked as a duplicate of this bug. ***