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
- How to install Clam Anti-virus (ClamAV)
- How to install MailScanner
SpamAssassin is included in CentOS 4 and ready to go out of the box. Just add it using the Package Management tool if you haven’t done so during CentOS installation. SpamAssassin is located in the Mail Server package.
Configuring MailScanner
%org-name% = your organization name %org-long-name% = your full organization name Run As User = postfix Run As Group = postfix Incoming Queue Dir = /var/spool/postfix/hold Outgoing Queue Dir = /var/spool/postfix/incoming MTA = postfix Virus Scanners = clamd Clamd Socket = /tmp/clamd.socket Use SpamAssassin = yes SpamAssassin User State Dir = /var/spool/MailScanner/spamassassin

2. Click Applications and click File Browser to launch the File Browser window and go to the /var/spool/MailScanner directory.
3. In the File Browser window, click File and click Create Folder. Name the new folder spamassassin.
5. In the Properties window, click the Permissions tab. In the Permissions page, set the File owner as postfix, the File group as postfix and check only the Owner Read, Write and Execute. Click Close when you are done. Repeat this for the quarantine and spamassassin folders.Integrating MailScanner into Postfix

1. Edit the file /etc/postfix/main.cf and remove the # in front of the line below header_checks = regexp:/etc/postfix/header_checks

2. Edit the file /etc/postfix/header_checks and add the line below to the bottom of the file/^Received:/ HOLDThis will now place all incoming mail into the holding area until released by MailScanner.

3. MailScanner should now be the one to start the Postfix service. Stop the Postfix service and start the MailScanner service in that order. Learn how to stop and start services here.
4. Test if Postfix is still working. See Test Postfix using Telnet.Congratulations
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.
***
Posted on 3/14/2007 and last updated on 3/24/2008
Filed under Anti-spam/Anti-virus , CentOS 4 , MailScanner , Postfix , Red Hat Enterprise Linux 4
Share This


January 26th, 2008 at 7:06 am
I did all of the above and it went well. I sent an email to user@myhostname.local via the telnet method, but it didn’t arrive. Then I realized I had not started clamd and spamassassin, so I started those. I sent another email and neither had arrived 30 minutes later. I checked /var/spool/postfix/hold and saw that they were there. Finally I restarted MailScanner/postfix and the mail arrived, with the MailScanner mesg on the bottom.