Integration into Courier-MTA using maildrop
First, install SpamAssassin and Courier MTA according to their installation docs. Make sure they are functioning on their own. You may want to use spamc/spamd for better performance. What's left is the connection between Courier and SpamAssassin.
If you have virtual users (as opposed to plain *nix users) you may have to let Spamassassin know where to find per-user preferences. This can be done by passing the username as an option to spamc using Courier's maildroprc config file as shown below, and then using the spamd --virtual-config-dir option. You can omit this if using only system-wide preferences.
To let Courier MTA use maildrop as default for delivery, edit /etc/courier/courierd
and set DEFAULTDELIVERY
to "| /usr/bin/maildrop"
(or wherever your maildrop binary is). Then edit /etc/courier/maildroprc
, the central maildrop script:
import USER if ($LOGNAME ne "") { xfilter "/usr/bin/vendor_perl/spamc -u $LOGNAME" } else { xfilter "/usr/bin/vendor_perl/spamc -u $USER" }
Via the xfilter line, maildrop pipes its contents through spamc before delivery.