Bogofilter doesn't work with qmail

Matthias Andree matthias.andree at gmx.de
Tue Jul 8 00:19:40 CEST 2003


Chris Wilkes <cwilkes-bf at ladro.com> writes:

> Here's how I've done it with stock qmail and now qmailldap, which has
> virtual users:
>
>    # cat .qmail
> 	| condredirect myname-spam /usr/bin/bogofilter -u -2
>    ./Maildir/
>
>    # cat .qmail-spam
>    ./Maildir/.spam/
>
> Replacing "myname" with the name of the account.  If bogofilter marks
> the email as spam it will get redelivered to the myname-spam account,
> which then drops into a different Maildir.  You can also have it add a
> line to the headers, but I find it easier to filter out like this.

This approach has some problems:

- it always updates the data bases, even when the message would
  otherwise be classified as "Unsure if spam or ham", this may be
  undesirable and pollute data bases

- bogofilter's exit code is incompatible with condredirect bogofilter
  may exit with codes other than 0 or 1 for temporary failures, in those
  cases, the message is considered as ham rather than pushed back to the
  queue.

A simple wrapper script like this might help:
(Nota bene: this is untested, I don't run qmail any more.)

#! /bin/sh
/usr/bin/bogofilter -u -3
e=$!
if [ $e -ge 2 ] ; then exit 111 ; else exit $e ; fi

Use this instead of /usr/bin/bogofilter -u -2 on your condredirect line.

-- 
Matthias Andree




More information about the Bogofilter mailing list