exit codes in docs

Greg Louis glouis at dynamicro.on.ca
Mon Aug 4 13:53:09 CEST 2003


On 20030804 (Mon) at 1126:24 +0200, Matthias Andree wrote:
> Greg Louis <glouis at dynamicro.on.ca> writes:
> 
> > I do think 0/1/2 (or whatever number prevents Matthias's onions from
> > getting in a bunch) for spam/nonspam/unsure is a useful modification. 
> > I made it for myself several months ago and would be glad to see the
> > convenience made available to the general bogofilter user population.
> 
> Personal preference/convenience cannot be the design basis of an
> interface. What if I want 0=spam 1=unsure 2=nonspam 3=error?

I could live fine with that.  It's the convenience of having an
"unsure" exit code that I request be made available.  Convenience (not
individual convenience, but user convenience) should, I'd have thought,
be the design basis of most interfaces.

It's the lack of an "unsure" exit code that caused poor David to have
to build a really convoluted generic version of my randomtrain script
so generic bogofilter could run it.  Now we can make it simple and
clean.

> Or the next one wants 0=error 1=spam 2=unsure 3=nonspam?

I wouldn't normally have a unix program exit with 0 for error, and I
don't think it unreasonable to refuse to do that.
 
> When we cannot agree on a scheme, leaving the interface (that is
> externally visible and crucial) unchanged doesn't appear as unsound to
> me.

Count me in with those who say it'll be time enough to cast brokenness
in concrete after 1.0.

I'll not abandon the use of the four exit codes, whatever path
bogofilter takes, unless the alternative allows scripting to be as
simple as the stuff I use in production now.

As for the simple procmail rule, what I want in production is exactly:
if bogofilter exits with 0, sequester the message as spam; else deliver
it.  If bogofilter exits with an error or unsure, the safe thing is to
deliver.  So:

:0HB:
* ? /usr/bin/bogofilter
/home/glouis/mail/bogo

does the trick nicely.
-- 
| G r e g  L o u i s         | gpg public key: 0x400B1AA86D9E3E64 |
|  http://www.bgl.nu/~glouis |   (on my website or any keyserver) |
|  http://wecanstopspam.org in signatures helps fight junk email. |




More information about the Bogofilter mailing list