

User=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f $Īlso the smtp interface must be changed to use spamassassin as a content filter by changing the following line in /etc/postfix/master.cf: smtp inet n - smtpd Postfix needs to be configured to route the e-mail to spamd, this is done by editing the /etc/postfix/master.cf file and create a new interface. To enable the daemon don’t forget to set ENABLED=1 in /etc/default/spamassassin Configuring Postfix The option –username=spamd tells the daemon to run as the user spamd, while –allow-tell allows learning through the spamc client. Change the OPTIONS line and add -u spamd so it reads as follows: OPTIONS="-username=spamd -allow-tell -create-prefs -max-children 5 -helper-home-dir"

The SpamAssassin daemon needs to be configured and enabled by editing /etc/default/spamassassin. Make sure you take note of the remarks on the items you need to enable and save the configuration as /etc/spamassassin/local.cf. There is a nice tool on the web to create a suitable configuration file for you. Now we still need to configure SpamAssassin itself. This will create the /var/lib/spamd/.razor and /var/lib/spamd/.pyzor directories with the configuration for these plugins. Then as this user we need to initialize the pyzor and razor clients: su - spamd For this reason we create a new user called spamd: useradd -r -m -d /var/lib/spamd -c 'SpamAssassin Daemon' spamd Configuring SpamAssassinįor security reasons we want SpamAssassin to run as a separate user. The packages pyzor and razor are optional, but they offer very valuable additional checks.
#Configuring spamassassin install#
To install SpamAssassin you need to install the following packages: apt-get install pyzor razor spamassassin spamc

I also assume that you want to configure a global SpamAssassin instance running as a separate user. In this guide I will assume you have configured postfix as your mailserver. If you run a mail server on Debian it is easy to install. SpamAssassin is probably the de-facto standard anti-spam solution.
