This tip shows how to setup Sendmail with Spamassassin on OpenBSD 3.9
First install Spamassassin:
# make install clean
Next install Procmail:
# make install clean
Now configure Sendmail to work with Spamassassin:
# cp openbsd-proto.mc openbsd-proto.mc.bak
Edit openbsd-proto.mc with your favorite editor adding/removing the following:
add: FEATURE(local_procmail)
add: MAILER(procmail)dnl
Next backup your current sendmail configuration, make and install the new sendmail configuration:
# cd /usr/share/sendmail/cf
# m4 ../m4/cf.m4 openbsd-proto.mc > /etc/mail/sendmail.cf
Create the file /etc/procmailrc and add the following to it:
DROPPRIVS=yes
:0fw
| spamc
Now add the following line to /etc/rc.local to start spamd at startup
echo -n “spamd”; /usr/local/bin/spamd &
Refer to tip 5 for setting sendmail to send/recieve email
Restart the server
Finally test your installation of Spamassassin with the following command:
Some of my personal configuration.
Since I don’t like spam coming to my clients at all, my /etc/procmailrc is as follows:
:0fw
| spamc
:0
* ˆX-Spam-Status: YES
* ˆX-Spam-Level: ******
/var/spool/spam/
This tells procmail to put messages marked as spam with a level higher than 6 to /var/spool/spam which is world writable.
For more information see the Spamassassin Wiki: http://wiki.apache.org/spamassassin/