Zero exit-code after SIGPIPE

View: New views
4 Messages — Rating Filter:   Alert me  

Zero exit-code after SIGPIPE

by RW-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm having a problem whereby Spamassassin is sometimes being killed by
SIGPIPE before it's written-out the email to stdout, and then
returns a zero exit-code.

Whilst I'd be keen to eliminate the SIGPIPE problem, the more important
problem is the return of the zero exit-code, because it turns delayed
mail into lost mail. Getmail treats it as success, delivers an empty
email with just it's own headers, and deletes the original off the
server. If I hack Spamassassin's default signal handler to return 1
then everything works correctly, the delivery is aborted, the email
gets left on the pop/imap server, and gets delivered on the next check.

Arguably, it might be pragmatic for the handler to return 0 (not spam)
if the "-e" option is used, but if it isn't then it should return a
non-zero error code.


I'm using  SpamAssassin 3.2.5 on FreeBSD 7.1, and using the
spamassassin script directly with no command-line options (i.e. without
the -e option)
 


Re: Zero exit-code after SIGPIPE

by John Hardin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 23 Jan 2009, RW wrote:

> I'm having a problem whereby Spamassassin is sometimes being killed by
> SIGPIPE before it's written-out the email to stdout, and then returns a
> zero exit-code.

Ouch.

Open a bug in the bugzilla. While the devs may read this list, they don't
use it for taking bug reports.

--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@...    FALaholic #11174     pgpk -a jhardin@...
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   We should endeavour to teach our children to be gun-proof
   rather than trying to design guns to be child-proof
-----------------------------------------------------------------------
  4 days until the 42nd anniversary of the loss of Apollo 1

Re: Zero exit-code after SIGPIPE

by RW-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 23 Jan 2009 11:00:15 -0800 (PST)
John Hardin <jhardin@...> wrote:

> On Fri, 23 Jan 2009, RW wrote:
>
> > I'm having a problem whereby Spamassassin is sometimes being killed
> > by SIGPIPE before it's written-out the email to stdout, and then
> > returns a zero exit-code.
>
> Ouch.
>
> Open a bug in the bugzilla. While the devs may read this list, they
> don't use it for taking bug reports.

Actually, I see there is a fairly recent bug report about this, it
should be fixed in the next release.

Re: Zero exit-code after SIGPIPE

by Karsten Bräckelmann-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 2009-01-23 at 18:30 +0000, RW wrote:
> I'm having a problem whereby Spamassassin is sometimes being killed by
> SIGPIPE before it's written-out the email to stdout, and then
> returns a zero exit-code.
>
> Whilst I'd be keen to eliminate the SIGPIPE problem, the more important
> problem is the return of the zero exit-code,  [...]

Bug 6033, fixed in SVN, patch for 3.2.x attached.
  https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6033


--
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}