Bogofilter and postfix (was: Bogofilter and Sendmail)

Matthias Andree matthias.andree at gmx.de
Fri Dec 5 00:32:13 CET 2003


On Thu, 04 Dec 2003, Bill Wohler wrote:

> I'm currently calling bogofilter with procmail. However, now that the
> @#$!@!# spammers have somehow discovered all of the mailing lists on my
> machine, I must now pass mail through bogofilter before it goes to the
> mailing lists. Using my own bogofilter DB is appropriate since I'm on
> all of the lists and therefore has been trained with the traffic on
> those lists.
> 
> It just occurred to me that I could change an alias such as:
> 
>   list:        "|/var/lib/mailman/mail/wrapper post list"
> 
> to
> 
>   list:        "|/usr/local/sbin/bogowrapper post list"
> 
> Where bogowrapper looks something like:
> 
>     umask 077
>     bogofilter -c /home/wohler/.bogofilter.cf \
>                -d /home/wohler/.bogofilter -3 -e -p > /tmp/bogowrapper$$
>     if `grep -q X-Bogosity: No /tmp/bogowrapper$$`; then

That needs to be "X-Bogosity: No" (with quote marks), to avoid "No: no
such file or directory" from grep.

> 	/var/lib/mailman/mail/wrapper $@ < /tmp/bogowrapper$$

And here, too, use "$@" not bare $@ although it looks OK in this sample.

>     else
> 	cat /tmp/bogowrapper$$ >> /usr/local/spool/spam
>     fi
>     rm /tmp/bogowrapper$$
> 
> That solution would be independent of the MTA. Is anyone's hackmeter
> going off?

Sorta. What in case of trouble? The script will just continue when you
actually want it to "exit 75" so Postfix can defer the mail and retry
later.




More information about the Bogofilter mailing list