Installing and configuring SpamAssassin

SpamAssassin is one of the most powerful spam filters that work with Postfix to filter all mails that may present a threat.

We will use it to filter all Postfix mails on our mail server (as we described in Chapter 4, Mail Server with Postfix, about how to get one up and running).

First, we need to install it using the default package manager:

$ sudo yum install spamassassin

Then it is installed. Now we move on to the configuration part:

$ sudo nano /etc/mail/spamassassin/local.cf

We have some lines that we need to make sure are in the file. So, we'd rather write them or uncomment them if they are commented:

rewrite_header Subject ***SPAM***
required_hits 5.0
report_safe 0
required_score 5

Next, we create ...

Get Mastering CentOS 7 Linux Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.