I was working on a Debian stable (woody) machine. This may work for other configs too. SpamAssassin is one of the few packages that should be more up2date than stable. The newer version is MUCH easier to use, and automagicly includes many of the features we all want (like Bayesian filtering). I got 3.0 from backports.org. Add the line:
deb http://www.backports.org/debian/ woody spamassassinto /etc/apt/sources.list and then
apt-get install spamassassin. to get the latest spamassassin on Debian stable.
This document assumes you already have postfix running.
smtp inet n - - - - smtpdto
smtp inet n - n - - smtpd -o content_filter=spamassassin:and add the line:
spamassassin unix - n n - - pipe flags=Rq user=mailfilt argv=/usr/local/bin/sa-filter.sh -f ${sender} ${recipient}to the end of the file.
-rwxr-xr-- 1 mailfilt mailfilt 71 Oct 25 11:27 /usr/local/bin/sa-filter.shwith the contents
#!/bin/bash /usr/bin/spamc | /usr/sbin/sendmail -i "$@" exit $?
/etc/init.d/spamassassin restart
/etc/init.d/postfix reload
I think that the default SpamAssassin config will do this, but I'm not totally sure. If you don't like the results, look for info on editing the /usr/share/spamassassin/local.cf file.