Postfix content_filter (Was: Re: mailing list speed)

Matthias Andree matthias.andree at gmx.de
Sat Oct 12 12:05:49 CEST 2002


On Tue, 08 Oct 2002, David Relson wrote:

> Since BOGOFILTER_DIR is defined, the "-d ..." is unnecessary.  Here's the 
> improved script:
> 
>     #!/bin/sh
> 
>     BOGOFILTER=/usr/local/bin/bogofilter
>     BOGOFILTER_DIR=/var/spool/filter
>     SENDMAIL=/usr/lib/sendmail
> 
>     # Exit codes from <sysexits.h>
>     EX_TEMPFAIL=75
>     EX_UNAVAILABLE=69
> 
>     cd $BOGOFILTER_DIR || { echo $BOGOFILTER_DIR does not exist; exit 
> $EX_TEMPFAIL; }
> 
>     # Clean up when done or when aborting.
>     trap "rm -f inp.$$ msg.$$" 0 1 2 3 15
> 
>     # bogofilter returns: 0 for spam; 1 for non-spam; 2 for I/O or other 
> errors.
> 
>     $BOGOFILTER -p > msg.$$

And with the new -e option, that gets:

# bogofilter -e -p returns: 0 for success (includes "spam"), 2 for errors
$BOGOFILTER -p -e > msg.$$ || exit $EX_TEMPFAIL

>     $SENDMAIL "$@" < msg.$$
> 
>     exit $?

-- 
Matthias Andree

For summay digest subscription: bogofilter-digest-subscribe at aotto.com



More information about the Bogofilter mailing list