Changing bogofilter output sense

Rick Mann rmann at latencyzero.com
Thu Jul 10 23:55:45 CEST 2003


Hi. I'm trying to use bogofilter with TMDA (http://tmda.net/). TMDA runs an
incoming message past a series of filters, generally checking against a
whitelist or blacklist.

But you can also execute a program or shell script. If the result of the
program is 0, then it's considered a match, and the specified disposition is
taken.

In my case, I want the first check to be the bogofilter check, and if
bogofilter decides it is spam, then I want to proceed with TMDA's
challenge-response system.

In order to do this, I need to write a line like:

pipe bogofilter accept

which tells TMDA to present the candidate message to bogofilter, and if
bogofilter returns with a 0, to accept the message. If bogofilter returns
with a 1, then TMDA will continue processing filter lines.

Unfortunately, bogofilter returns a 0 for spam, and 1 for good mail. I would
like to invert the sense of bogofilter's output, so that it returns a 1 for
spam and 0 for good mail.

Note that the converse of the line above,

pipe bogofilter confirm

does not behave correctly, because it tells TMDA to confirm a message
bogofilter considers to be spam, and to continue checking messages
bogofilter considers to be ham. However, there are lines after the
bogofilter line that expect a message to likely be spam.

I would prefer the primary check to be bogofilter, but to do that I need to
reverse the output values. I suppose I could patch my own copy, but it'd be
nice if there was a command line option to do this.

Thank you!

-- 
Rick





More information about the Bogofilter mailing list