Mainos / Advertisement:

Spamassassin

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.

Installation

Install Spamassassin with aptitude

 aptitude install spamassassin

Configuration

We create a user for the Spamassassin program.

 adduser spamd --disabled-login

Open file:

 /etc/default/spamassassin

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

 ENABLED=1

We have to configure home- and settings parameters.

 SPAMD_HOME="/home/spamd/"
 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:

 PIDFILE="${SPAMD_HOME}spamd.pid"

We want Spamassassin rules and settings to update automatically:

 CRON=1

The entire Spamassassin config file can be found here: https://www.dropbox.com/s/ndvpgc2jipdd4bk/etc.default.spamassassin.txt

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

Testing

Send the text found below to your e-mail server

   XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

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

Sources

https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin

http://spamassassin.apache.org/gtube/

Mainos / Advertisement: