Bogofilter and postfix (was: Bogofilter and Sendmail)
David Relson
relson at osagesoftware.com
Fri Dec 5 00:56:28 CET 2003
On Thu, 04 Dec 2003 13:27:22 -0800
Bill Wohler <wohler at newt.com> wrote:
...[snip]...
> 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
> /var/lib/mailman/mail/wrapper $@ < /tmp/bogowrapper$$
> else
> cat /tmp/bogowrapper$$ >> /usr/local/spool/spam
> fi
> rm /tmp/bogowrapper$$
Hi Bill,
Your bogofilter command can be simplified. "bogofilter -e -p >
/tmp/bogowrapper$$" should be sufficient since you're using bogofilter's
default paths config file and wordlist paths. Also the "-3" is not
necessary. If you have ham_cutoff set in your config file, bogofilter
will use tri-state mode.
Also, if you don't want the X-Bogosity line in the file, you can do
something like:
cat > /tmp/bogowrapper$$
if [ bogofilter < /tmp/bogowrapper$$ ] ; then
# is spam
cat /tmp/bogowrapper$$ >>/usr/local/spool/spam
else
# is non-spam
/var/lib/mailman/mail/wrapper "$@" < /tmp/bogowrapper$$
fi
rm /tmp/bogowrapper$$
Note: be sure to test thoroughly to avoid typos and other mistreaks.
David
More information about the Bogofilter
mailing list