How To Install spamassassin on CentOS 7

In this tutorial we learn how to install spamassassin on CentOS 7. spamassassin is Spam filter for email which can be invoked from mail delivery

Introduction

In this tutorial we learn how to install spamassassin on CentOS 7.

What is spamassassin

SpamAssassin provides you with a way to reduce if not completely eliminate Unsolicited Commercial Email (SPAM) from your incoming email. It can be invoked by a MDA such as sendmail or postfix, or can be called from a procmail script, .forward file, etc. It uses a genetic-algorithm evolved scoring system to identify messages which look spammy, then adds headers to the message so they can be filtered by the user’s mail reading software. This distribution includes the spamd/spamc components which create a server that considerably speeds processing of mail. To enable spamassassin, if you are receiving mail locally, simply add this line to your ~/.procmailrc INCLUDERC=/etc/mail/spamassassin/spamassassin-default.rc To filter spam for all users, add that line to /etc/procmailrc (creating if necessary).

We can use yum or dnf to install spamassassin on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install spamassassin.

Install spamassassin on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install spamassassin using yum by running the following command:

sudo yum -y install spamassassin

Install spamassassin on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install spamassassin using dnf by running the following command:

sudo dnf -y install spamassassin

How To Uninstall spamassassin on CentOS 7

To uninstall only the spamassassin package we can use the following command:

sudo dnf remove spamassassin

References

Summary

In this tutorial we learn how to install spamassassin on CentOS 7 using yum and dnf.