SA Bugzilla – Bug 507
dccproc available test results in broken pipe and returns to procmail
Last modified: 2002-07-24 08:24:33 UTC
Symptom: grep ^rom /var/spool/mail/user returns positive results. "F" missing from mbox format. Results in mail messages being joined together. Problem is intermittent. Running SpamAssassin 2.31 on RedHat 6.2 procmail-3.21-0.62 perl-5.00503-12 spamassassin -P -D -F1 -c /home/user/bin/SpamAssassin/rules DEBUG messages: Example of success - . . debug: running raw-body-text per-line regexp tests; score so far=22.4 debug: running full-text regexp tests; score so far=29.1 debug: Razor is not available debug: spam-phrase score: 1.61229429865649e-06: hits: debug: DCC is available: sh: dccproc: command not found debug: DCC -> check failed - Broken pipe. debug: Ran run_rbl_eval_test rule RCVD_IN_DSBL but did not get hit debug: Ran run_rbl_eval_test rule RCVD_IN_MULTIHOP_DSBL but did not get hit debug: Ran run_rbl_eval_test rule RCVD_IN_ORBS but did not get hit . . Example of failure: . . debug: running raw-body-text per-line regexp tests; score so far=25.6 debug: running full-text regexp tests; score so far=27.2 debug: Razor is not available debug: spam-phrase score: 14.0170176034901: hits: click here, days money, email address, enter your, list please, mone y back, please click, this email, this message, you wish, your email, your name debug: DCC is available: sh: dccproc: command not found procmail: [23693] Tue Jun 25 19:38:30 2002 procmail: Program failure (-13) of "/home/user/bin/SpamAssassin/spamassassin" procmail: Rescue of unfiltered data succeeded procmail: [23693] Tue Jun 25 19:38:30 2002 . . . I traced the dccproc available code back to ./lib/Mail/SpamAssassin/Dns.pm ./lib/Mail/SpamAssassin/Reporter.pm ./blib/lib/Mail/SpamAssassin/Dns.pm ./blib/lib/Mail/SpamAssassin/Reporter.pm . . if (!open(DCCHDL, "dccproc -V 2>&1 |")) { dbg ("DCC is not available"); return 0; } . . I commented out this block of code and just always returned 0. (I couldn't find a way to disable dccproc via a user_prefs option) I am not longer experiencing the problem. This may be a problem with perl and how it is handling broken pipes.
Created attachment 212 [details] patch to lib/Mail/SpamAssassin/Dns.pm that fixes check for DCC
I ran into this problem, as well. In perl a pipe open() doesn't allow for you to easily check whether the command succeeded, so my patch first calls system(), then only does an open() if the system() succeeds.
accepted patch into CVS
I'm now getting these errors during "make test": readline() on closed filehandle Mail::SpamAssassin::PerMsgStatus::DCCHDL at ../lib/Mail/SpamAssassin/Dns.pm line 399. readline() on closed filehandle Mail::SpamAssassin::PerMsgStatus::DCCHDL at ../lib/Mail/SpamAssassin/Dns.pm line 399.
yep, noted -- I've added another block (in CVS) which should fix it.
good catch. i should have left the check on open()'s return value in. under what conditions would the system() succeed, but the open() fail? maybe we should do this? --- Dns.pm 9 Jul 2002 17:17:05 -0000 1.48 +++ Dns.pm 9 Jul 2002 17:48:03 -0000 @@ -397,7 +397,7 @@ # jm: this could still fail if (!open(DCCHDL, "dccproc -V 2>&1 |")) { - dbg ("DCC is not available: open failed"); + dbg ("DCC is not available: open failed: $!"); return 0; }
I dunno -- seems odd, as I simply don't have dcc installed (yet ;). Maybe it's platform-specific -- I'm on Red Hat 7.3 at the mo'.
think this should be fixed.