Mainos / Advertisement:


From Taisto
Jump to navigation Jump to search
This page is a translated version of the page Spamassassin and the translation is 100% complete.

Other languages:
English • ‎suomi

Spamassassin is an effective way to block junk mail in Postfix. Spamassassin requires Postfix to be installed before you can install Spamassassin.

Spamassassin marks junk mail with a "*****SPAM*****" notification in the e-mail topic line.


Install Spamassassin with aptitude

 aptitude install spamassassin


We create a user for the Spamassassin program.

 adduser spamd --disabled-login

Open file:


We enable Spamassassin by changing the ENABLED parameter from 0 to 1


We have to configure home- and settings parameters.

 OPTIONS="--create-prefs --max-children 5 --username spamd --helper-home-dir ${SPAMD_HOME} -s ${SPAMD_HOME}spamd.log"

We must use a certain type of PID_FILE parameter:


We want Spamassassin rules and settings to update automatically:


The entire Spamassassin config file can be found here:

Open the Postfix konfiguration file

 nano /etc/postfix/master.conf

Find the line

 smtp      inet  n       -       -       -       -       smtpd

and below the line add:

 -o content_filter=spamassassin

The end result:

 smtp      inet  n       -       -       -       -       smtpd
         -o content_filter=spamassassin

Add this to the end of the file:

 spamassassin unix -     n       n       -       -       pipe
       user=spamd argv=/usr/bin/spamc -f -e  
       /usr/sbin/sendmail -oi -f ${sender} ${recipient}

And in the end restart the services so the changes will apply.

 service postfix restart
 service spamassassin restart


Send the text found below to your e-mail server


When it arrives it should have a *****SPAM***** in the topic line of the e-mail.


Mainos / Advertisement: