What is amavisd-new, ClamAV and SpamAssassin?
amavisd-new is a high-performance interface between mailer (MTA) and content checkers: virus scanners, and/or SpamAssassin.
Clam AntiVirus (ClamAV) is a free and open-source, cross-platform antivirus software toolkit able to detect many types of malicious software, including viruses. One of its main uses is on mail servers as a server-side email virus scanner.
SpamAssassin is a mail filter to identify spam. It is an intelligent email filter which uses a diverse range of tests to identify unsolicited bulk email, more commonly known as Spam.
yum install amavisd-new
☑ This will install amavisd-new and a bunch of dependencies. It will also install SpamAssassin by default.
yum install clamav clamav-update
☑ This will install ClamAV.
☑ This will update the ClamAV database.
☑ Edit amavisd.conf.
Change the following lines like this…
$mydomain = ‘domain.com’; # a convenient default for other settings
$myhostname = 'mail.domain.com’; # must be a fully-qualified domain name and same as reverse DNS lookup
☑ Make sure everything is set in postfix’s configuration file master.cf
On top of master.cf, you should have something like…
smtp inet n - n - - smtpd
…and on bottom, you should have something like…
# spam/virus section
smtp-amavis unix - - y - 2 smtp
127.0.0.1:10025 inet n - y - - smtpd
☑ Stop the postfix daemon.
service postfix stop
☑ Start Spamassassin, Amavisd-new and ClamAV daemons.
service spamassassin start
service amavisd start # This will also start ClamAV
☑ Start the postfix daemon.
service postfix start
That’s it! Now you have a basic spam and virus protection up and running on your CentOS server. ?