this is obsolete doc -- see http://doc.nethence.com/ instead
Setting up SpamProbe bayesian spam filtering on FreeBSD
Installation
Make sure it is installed,
pkg_info | grep spamprobe
Configuration
Create a folder for SpamProbe to store it's Berkeley DB databases,
cd ~/
mkdir -p .spamprobe/
Setup your procmail Local Delivery Agent so it calls SpamProbe to filter incomming messages,
cd ~/
vi .procmailrc
at some point at the beginning of the rule sets, add,
# Invoke spamprobe
:0
SCORE=| spamprobe train
:0 wf
| formail -I "X-SpamProbe: $SCORE"
:0 a:
*^X-SpamProbe: SPAM
.spam.spamprobe/
Ready to go
Send a test email to the recipient while reading the procmail logs e.g.,
cd ~/
tail -F .procmailrc.log.2013
Learn, unlearn and long-term maintenance
Prepare a script to be executed nightly by the cron daemon,
mkdir -p ~/bin/
cd ~/bin/
cat > spamprobe.sh <EOF9
#!/bin/sh
IMAPDIR=$HOME/Maildir
spamprobe remove $IMAPDIR/.remove/
spamprobe good $IMAPDIR/.nonspam/
spamprobe spam $IMAPDIR/.spam/
spamprobe train-spam $IMAPDIR/.spamprobe/
EOF9
It's also good to proceed with some clean-ups of words that haven't been seen as spam in the last two weeks (first option, commented out) or even six monthes (hereby enabled).
Configure the cron tab for the mail user,
crontab -e
PATH=/sbin:/sbin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$HOME/bin
02 00 * * * spamprobe.sh
#03 00 * * * spamprobe cleanup 2 14
03 00 * * * spamprobe cleanup 1000 180 2 14
References
Welcome to SpamProbe - A Fast Bayesian Spam Filter: http://spamprobe.sourceforge.net/
spamprobe(1)
SpamProbe v1.4 README: http://spamprobe.sourceforge.net/README.txt