Bug 507 - dccproc available test results in broken pipe and returns to procmail
Summary: dccproc available test results in broken pipe and returns to procmail
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 2.31
Hardware: PC Linux
: P2 major
Target Milestone: ---
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-25 21:34 UTC by Richard
Modified: 2002-07-24 08:24 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
patch to lib/Mail/SpamAssassin/Dns.pm that fixes check for DCC patch None Ryan Cleary [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Richard 2002-06-25 21:34:47 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.
Comment 1 Ryan Cleary 2002-07-07 12:40:21 UTC
Created attachment 212 [details]
patch to lib/Mail/SpamAssassin/Dns.pm that fixes check for DCC
Comment 2 Ryan Cleary 2002-07-07 12:48:07 UTC
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.
Comment 3 Justin Mason 2002-07-08 08:23:03 UTC
accepted patch into CVS
Comment 4 Bart Schaefer 2002-07-09 10:03:00 UTC
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.
Comment 5 Justin Mason 2002-07-09 10:22:03 UTC
yep, noted -- I've added another block (in CVS) which should fix it.
Comment 6 Ryan Cleary 2002-07-09 10:50:41 UTC
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;
   }
   
Comment 7 Justin Mason 2002-07-09 11:02:54 UTC
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'.
Comment 8 Justin Mason 2002-07-24 16:24:33 UTC
think this should be fixed.