This page will guide you in configuring MailScanner, ClamAV and SpamAssassin to work in Postfix. Before proceeding, please make sure that all of the above components are already installed.
Here are the installation guides for the above components.
- How to install Postfix SMTP Server for RHEL/CentOS 6 / for RHEL/CentOS 5
- How to install Clam Anti-virus (ClamAV)
- How to install MailScanner
SpamAssassin is included in Red Hat Enterprise Linux and CentOS and it’s ready to go out of the box. If it is not yet installed in your system, use the command below to install it.
yum install spamassassin
%org-name% = your organization name %org-long-name% = your full organization name %web-site% = your mail support website or company website Run As User = postfix Run As Group = postfix Incoming Queue Dir = /var/spool/postfix/hold Outgoing Queue Dir = /var/spool/postfix/incoming MTA = postfix Incoming Work Group = clam Incoming Work Permissions = 0640 Virus Scanners = clamd Clamd Socket = /var/run/clamav/clamd.sock Use SpamAssassin = yes SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin
cd /var/spool/MailScanner/ mkdir spamassassin chown -R postfix.clam * chmod -R 750 * restorecon -R ../MailScanner/
wget linuxmail.info/files/rhel6/freshclamtmp.te checkmodule -M -m -o freshclamtmp.mod freshclamtmp.te semodule_package -o freshclamtmp.pp -m freshclamtmp.mod semodule -i freshclamtmp.pp
Integrating MailScanner into Postfix
header_checks = regexp:/etc/postfix/header_checks
/^Received:/ HOLDThis will now place all incoming mail into the holding area until released by MailScanner.
chkconfig postfix off chkconfig clamd on chkconfig MailScanner on service postfix stop service clamd start service MailScanner start
Congratulations, your mails are now checked for spam and viruses. Each mail you send or receive will now contain the lines below to indicate that MailScanner is doing its job.
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Visit the forum to ask for help or to give a comment.