Postfix Email Spam check with Spamassasin on Linux

Using Spamassassin with Postfix

Install Spamassasin using the following:

 yum install spamassassin spamc

Configuring Postfix to use Spamassasin. In “/etc/postfix/master.cf”, change this:

 smtp      inet  n       -       -       -       -       smtpd

To be this:

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

Add this to the end of “/etc/postfix/master.cf”:

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

Edit the file “/etc/default/spamassassin” and set the “Enabled” variable to “1″:

ENABLED=1

Create the “spamd” user:

useradd spamd

The reload Postfix:

 /etc/init.d/postfix reload

Stop and start the Spam Assassin daemon on Linux. You need to be root to do this.

 /etc/init.d/spamassassin stop
 /etc/init.d/spamassassin start

Sometimes you must replace “spamassassin” in the above with “spamd”.

Leave a Reply

Your email address will not be published.

*