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
Configuring MailScanner
%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/

4. For RHEL/CentOS 6, configure SELinux using the commands below. Here’s the content of freshclamtmp.tewget 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

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.


chkconfig postfix off chkconfig clamd on chkconfig MailScanner on service postfix stop service clamd start service MailScanner start

4. Test if Postfix is still working. See Test Postfix using Telnet.
If you encounter any problems, check the log file at /var/log/maillog.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.
The English language message templates used in MailScanner is stored in /etc/MailScanner/reports/en and can even be configured to add a disclaimer message to outgoing mails.Visit the forum to ask for help or to give a comment.
***
Posted on 4/25/2007 and last updated on 3/16/2012
Filed under Anti-spam/Anti-virus , CentOS 5 , CentOS 6 , MailScanner , Postfix , Red Hat Enterprise Linux 5 , Red Hat Enterprise Linux 6


March 4th, 2008 at 3:12 am
There are log files for errors?
How many time takes to release a one line mail MailScanner?
The telnet test does not send any mail so far.
Thanks.
March 4th, 2008 at 12:11 pm
> Are there log files for errors?
I don’t think so. The problem I usually encounter are mails getting stuck in /var/spool/postfix/hold. This happens when one of the component, either the anti-virus or anti-spam is not configured properly.
March 11th, 2008 at 4:27 am
I had to change the setting
Clamd Socket = /tmp/clamd
to
Clamd Socket = /tmp/clamd.socket
in the mailscanner.conf
else I got his error
Cannot find Socket (/tmp/clamd) Exiting!
in the maillog.
Otherwise your webpage was excellent.
Have you tried webmin?
Thanks
Todd
March 24th, 2008 at 10:41 am
I can’t find this folder /etc/MailScanner/MailScanner.conf
March 24th, 2008 at 12:35 pm
Hi Froylan,
You probably wasn’t able to successfully install MailScanner. There should be a /etc/MailScanner folder and a MailScanner.conf file in it. Try installing MailScanner from a terminal window to see the error.
March 24th, 2008 at 12:40 pm
Hi Todd,
You’re right about clamd socket, I must have missed that out when I was documenting the steps. I’ve corrected the text, thank you very much.
I haven’t tried out webmin, but I’ve seen the screenshots and it looks very interesting.
March 24th, 2008 at 2:27 pm
this my error
error: Failed dependencies:
perl-MIME-tools >= 5.412 is needed by mailscanner-4.67.6-1.noarch
March 24th, 2008 at 6:00 pm
No idea why that one occurred. Below is from http://www.mailscanner.info/linux.html
“If it fails to install the MIME-tools module, then something has gone wrong and you should look back through the script’s output and try to determine what failed.”
March 28th, 2008 at 2:36 pm
hi to all
how im going to change or create my own domain instead of @localhost.localdomain… I have this error sending email to my email server alwways have this msgs…
This is an automatically generated Delivery Status Notification
Delivery to the following recipient failed permanently:
lhan@localhost.localdomain
Technical details of permanent failure:
PERM_FAILURE: DNS Error: Domain name not found
March 28th, 2008 at 11:56 pm
Goto the Network Configuration window by clicking on System > Administrator > Network. From the Network Configuration window, click the DNS tab.
April 19th, 2008 at 6:06 am
Hi,
I’m having this permission problem:
Apr 19 13:39:23 localhost dovecot: POP3(fbm): Mailbox init failed top=0/0, retr=0/0, del=0/1, size=495
Apr 19 13:39:57 localhost dovecot: pop3-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Apr 19 13:39:57 localhost dovecot: POP3(fbm): open(/home/fbm/Maildir/cur/auth:2,) failed: Permission denied
Apr 19 13:39:57 localhost dovecot: POP3(fbm): open(/home/fbm/Maildir/cur/auth:2,) failed: Permission denied
This happened after integrating MainScanner to postfix. What could have caused this?
April 19th, 2008 at 6:38 am
I made an additional test to see if this problem will appear also with other users. I created a new user, sent mail to it, checked via telnet and I was able to log-in and get the message. This means that the configuration is correct, but this user has some problems with it’s mailbox (the one I initially used for testing). What could be causing this for this user?
April 19th, 2008 at 7:07 am
Please disregard previous two posts. Found out that I made a symbolic link pointing to nowhere in Maildir/cur directory. Everything is all working ok now.
April 29th, 2008 at 6:05 pm
My mail is held in /var/spool/postfix/hold directory as shown below:
-rwx—— 1 postfix postfix 1071 Apr 29 11:48 EC743191808D
Clam seems to be fine.
[root@www_01 ~]# clamscan
/root/.esd_auth: OK
/root/.tcshrc: OK
/root/.viminfo: OK
/root/.Xauthority: Empty file
/root/.rpmmacros: OK
/root/.bash_logout: OK
/root/anaconda-ks.cfg: OK
/root/.bash_profile: OK
/root/.bash_history: OK
/root/install.log.syslog: OK
/root/.cshrc: OK
/root/.bashrc: OK
/root/.lesshst: OK
/root/.dmrc: OK
/root/install.log: OK
/root/.xauth7luPa5: OK
/root/.rnd: OK
/root/.ICEauthority: OK
/root/.gtkrc-1.2-gnome2: OK
———– SCAN SUMMARY ———–
Known viruses: 272239
Engine version: 0.93
Scanned directories: 1
Scanned files: 18
Infected files: 0
Data scanned: 0.07 MB
Time: 1.687 sec (0 m 1 s)
[root@www_01 ~]#
The only error I can find from /var/log/maillog is:
Apr 29 13:10:03 www_01 ClamAV-autoupdate[13773]: ClamAV updater /usr/local/bin/freshclam cannot be run
What can be wrong here? Any suggestion?
April 29th, 2008 at 7:31 pm
See this link at http://forum.ensim.com/showthread.php?s=&threadid=10394 on how to fix freshclam fails to run issue.
I have “Clamd Socket = /tmp/clamd.socket” in /etc/MailScanner/MailScanner.conf file. However, I have this error in /var/log/maillog:
Apr 29 15:07:22 www_01 MailScanner[15291]: Cannot find Socket (/tmp/clamd.socket) Exiting!
Any suggestion?
April 29th, 2008 at 10:09 pm
Last issue was resolved by restarting clamd.
The problem now is:
Apr 29 18:03:06 www_01 MailScanner[4178]: Clamd::ERROR:: UNKNOWN CLAMD RETURN ./lstat() failed. ERROR :: /var/spool/MailScanner/incoming/4178
It looks there are inconsistent permission settings between ClamAV and MailScanner. Any suggestion?
April 30th, 2008 at 2:50 pm
I was able to resolve this one with help from this link http://www.nuonce.net/support/viewthread.php?tid=1856 and setting ‘Virus Scanners = clamav’ in /etc/MailScanner/MailScanner.conf file.
Thanks,
Vince
April 30th, 2008 at 2:54 pm
I would like to customize the message appended at the end of each email.
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
I assume it’s configurable but where. Anyone knows?
Thanks,
Vince
May 1st, 2008 at 2:18 pm
Hi Vince,
Thank you very much for your comments. Something must have changed with either MailScanner or ClamAV which broke the guide. I’ve updated the text above, thanks again.
The answer came from MailScanner.conf
Note: If the “Run As User” is “root” (or not set at all) and you are using the “clamd” virus scanner, then this must be set:
Incoming Work Group = clamav
Incoming Work Permissions = 0640
Setting Virus Scanners = clamav will definitely fix the problem but I prefer to use the best option available which is clamd. See MailScanner now directly supports Clam Antivirus
I’ve also updated the text to correct the freshclam problem. Thanks for the link to the solution.
To change the inline signature and mail templates, go to /etc/MailScanner/reports/en for the English templates.
May 12th, 2008 at 6:12 am
Hi,
after following the steps, i m getting the following response:
[root@localhost ~]# telnet localhost smtp
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
Connection closed by foreign host.
help needed.
shyam
May 12th, 2008 at 11:43 am
Please check the log file at /var/log/maillog
May 17th, 2008 at 9:54 am
The log is showing like this:
May 17 15:01:02 localhost update.bad.phishing.sites: Delaying cron job up to 600 seconds
May 17 15:07:56 localhost postfix/pickup[10037]: 6D3F8648A38: uid=501 from=
May 17 15:07:56 localhost postfix/cleanup[10638]: 6D3F8648A38: hold: header Received: by localhost.localdomain (Postfix, from userid 501)??id 6D3F8648A38; Sat, 17 May 2008 15:07:56 +0530 (IST) from local; from= to=
May 17 15:07:56 localhost postfix/cleanup[10638]: 6D3F8648A38: message-id=
May 17 15:07:57 localhost MailScanner[9930]: New Batch: Scanning 1 messages, 726 bytes
May 17 15:07:58 localhost MailScanner[9930]: Virus and Content Scanning: Starting
May 17 15:07:58 localhost MailScanner[10641]: Cannot find Socket (/tmp/clamd.socket) Exiting!
May 17 15:07:58 localhost MailScanner[9930]: Requeue: 6D3F8648A38.36E0B to 72E59648A37
May 17 15:07:58 localhost postfix/qmgr[5582]: 72E59648A37: from=, size=896, nrcpt=1 (queue active)
May 17 15:07:58 localhost MailScanner[9930]: Uninfected: Delivered 1 messages
May 17 15:07:59 localhost postfix/qmgr[5582]: 72E59648A37: to=, relay=none, delay=2.7, delays=2.6/0.06/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=tanaashi.com type=MX: Host not found, try again)
May 17 15:10:50 localhost postfix/qmgr[5582]: 12D7D6489D7: from=, size=896, nrcpt=1 (queue active)
May 17 15:10:50 localhost postfix/qmgr[5582]: 12D7D6489D7: to=, relay=none, delay=7373, delays=7373/0.03/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=tanaashi.com type=MX: Host not found, try again)
May 17 15:10:50 localhost postfix/qmgr[5582]: 6F3E36489DB: from=, size=896, nrcpt=1 (queue active)
May 17 15:10:50 localhost postfix/qmgr[5582]: 6F3E36489DB: to=, relay=none, delay=3774, delays=3774/0.01/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=tanaashi.com type=MX: Host not found, try again)
May 17 15:10:50 localhost postfix/qmgr[5582]: B3A176489DC: from=, size=896, nrcpt=1 (queue active)
May 17 15:10:50 localhost postfix/qmgr[5582]: B3A176489DC: to=, relay=none, delay=1974, delays=1974/0/0/0, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=tanaashi.com type=MX: Host not found, try again)
May 17 15:11:04 localhost update.virus.scanners: Delaying cron job up to 600 seconds
May 17 15:12:59 localhost update.virus.scanners: Found clamav installed
May 17 15:12:59 localhost update.virus.scanners: Running autoupdate for clamav
May 17 15:13:00 localhost ClamAV-autoupdate[10759]: ClamAV update warning: ERROR: Please edit the example config file /usr/local/etc/freshclam.conf.
May 17 15:13:00 localhost ClamAV-autoupdate[10759]: ClamAV update warning: ERROR: Please edit the example config file /usr/local/etc/clamd.conf.
May 17 15:13:00 localhost ClamAV-autoupdate[10759]: ClamAV update warning: ERROR: Can’t parse the config file /usr/local/etc/clamd.conf
May 17 15:13:00 localhost ClamAV-autoupdate[10759]: ClamAV updater failed
May 17 15:13:00 localhost update.virus.scanners: Found generic installed
May 17 15:13:00 localhost update.virus.scanners: Running autoupdate for generic
May 17 15:26:00 localhost postfix/smtpd[11133]: warning: SASL: Connect to private/auth failed: Connection refused
May 17 15:26:00 localhost postfix/smtpd[11133]: fatal: no SASL authentication mechanisms
May 17 15:26:01 localhost postfix/master[2693]: warning: process /usr/libexec/postfix/smtpd pid 11133 exit status 1
May 17 15:26:01 localhost postfix/master[2693]: warning: /usr/libexec/postfix/smtpd: bad command startup — throttling
thanks.
shyam
May 18th, 2008 at 10:34 pm
Please describe your problem.
July 15th, 2008 at 10:09 pm
HELP!!! I have follow all the steps in this article, but I have a problem in the end when I try to test if postfix is still working…
this is the error:
[root@localhost ~]# telnet localhost smtp
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 localhost.localdomain ESMTP Postfix
ehlo host
250-localhost.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: udla1
452 4.3.1 Insufficient system storage
Please this is for a very important exam!!! HELP!!!
July 16th, 2008 at 6:35 am
You don’t have enough space available. See
http://www.postfix.org/postconf.5.html#queue_minfree
July 16th, 2008 at 3:54 pm
Thanks for the information… I enter in the main.cf file of postfix and I haven’t found the parameter queue_minfree, so I added this to the bottom of the file, but even then appears the same problem… I don’t know what to do… please help!!!
July 16th, 2008 at 10:21 pm
You can check your available space by typing in df -h
July 17th, 2008 at 3:46 pm
Thanks… Now everything is working, maybe you know where I can find a good manual to do a cache dns with bind, I have to add this to my project. Thanks again for all!!!!… I owe you one!!!!
September 23rd, 2008 at 2:14 pm
Hi to all,
All of my emails are held in “/var/spool/postfix/hold”.
In /var/log/maillog there is no error only for clamav update.
Can anybody help me about this issue?
November 13th, 2008 at 12:27 pm
Hi,
First of all, thanks for this great guide.
I’ve succeeded setting up my own mail server by following this guide.
My mail server was working fine before, but when I installed MailScanner and ClamAV, I cannot telnet localhost 25 anymore. I dont know what was wrong.
Below is what in my terminal when I do telnet localhost 25.
[root@tuah ~]# telnet localhost 25
Trying 192.168.0.3…
telnet: connect to address 192.168.0.3: Connection refused
telnet: Unable to connect to remote host: Connection refused
[root@tuah ~]#
and below is from the maillog
Nov 14 19:56:45 tuah dovecot: Dovecot v1.0.7 starting up
Nov 14 19:56:46 tuah postfix/postfix-script: starting the Postfix mail system
Nov 14 19:56:46 tuah postfix/master[2614]: fatal: bind 192.168.0.3 port 25: Address already in use
Nov 14 19:56:51 tuah MailScanner[2640]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 19:56:51 tuah MailScanner[2640]: Read 848 hostnames from the phishing whitelist
Nov 14 19:56:51 tuah MailScanner[2640]: Read 7059 hostnames from the phishing blacklist
Nov 14 19:56:51 tuah MailScanner[2640]: SpamAssassin temporary working directory is /tmp
Nov 14 19:56:51 tuah postfix/postfix-script: starting the Postfix mail system
Nov 14 19:56:51 tuah postfix/master[2696]: fatal: bind 192.168.0.3 port 25: Address already in use
Nov 14 19:56:52 tuah MailScanner[2640]: Using SpamAssassin results cache
Nov 14 19:56:52 tuah MailScanner[2640]: Connected to SpamAssassin cache database
Nov 14 19:56:52 tuah MailScanner[2640]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 19:56:54 tuah MailScanner[2640]: Using locktype = flock
Nov 14 19:56:56 tuah MailScanner[2794]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 19:56:56 tuah MailScanner[2794]: Read 848 hostnames from the phishing whitelist
Nov 14 19:56:57 tuah MailScanner[2794]: Read 7059 hostnames from the phishing blacklist
Nov 14 19:56:57 tuah MailScanner[2794]: SpamAssassin temporary working directory is /tmp
Nov 14 19:56:57 tuah MailScanner[2794]: Using SpamAssassin results cache
Nov 14 19:56:57 tuah MailScanner[2794]: Connected to SpamAssassin cache database
Nov 14 19:56:57 tuah MailScanner[2794]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 19:56:58 tuah MailScanner[2794]: Using locktype = flock
Nov 14 19:57:01 tuah MailScanner[2858]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 19:57:01 tuah MailScanner[2858]: Read 848 hostnames from the phishing whitelist
Nov 14 19:57:01 tuah MailScanner[2858]: Read 7059 hostnames from the phishing blacklist
Nov 14 19:57:01 tuah MailScanner[2858]: SpamAssassin temporary working directory is /tmp
Nov 14 19:57:01 tuah MailScanner[2858]: Using SpamAssassin results cache
Nov 14 19:57:01 tuah MailScanner[2858]: Connected to SpamAssassin cache database
Nov 14 19:57:01 tuah MailScanner[2858]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 19:57:03 tuah MailScanner[2858]: Using locktype = flock
Nov 14 19:57:06 tuah MailScanner[2947]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 19:57:07 tuah MailScanner[2947]: Read 848 hostnames from the phishing whitelist
Nov 14 19:57:07 tuah MailScanner[2947]: Read 7059 hostnames from the phishing blacklist
Nov 14 19:57:07 tuah MailScanner[2947]: SpamAssassin temporary working directory is /tmp
Nov 14 19:57:07 tuah MailScanner[2947]: Using SpamAssassin results cache
Nov 14 19:57:07 tuah MailScanner[2947]: Connected to SpamAssassin cache database
Nov 14 19:57:07 tuah MailScanner[2947]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 19:57:08 tuah MailScanner[2947]: Using locktype = flock
Nov 14 19:57:11 tuah MailScanner[3070]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 19:57:11 tuah MailScanner[3070]: Read 848 hostnames from the phishing whitelist
Nov 14 19:57:11 tuah MailScanner[3070]: Read 7059 hostnames from the phishing blacklist
Nov 14 19:57:11 tuah MailScanner[3070]: SpamAssassin temporary working directory is /tmp
Nov 14 19:57:12 tuah MailScanner[3070]: Using SpamAssassin results cache
Nov 14 19:57:12 tuah MailScanner[3070]: Connected to SpamAssassin cache database
Nov 14 19:57:12 tuah MailScanner[3070]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 19:57:13 tuah MailScanner[3070]: Using locktype = flock
Nov 14 20:01:01 tuah update.bad.phishing.sites: Delaying cron job up to 600 seconds
Nov 14 20:03:21 tuah update.virus.scanners: Delaying cron job up to 600 seconds
Nov 14 20:05:57 tuah update.virus.scanners: Found clamav installed
Nov 14 20:05:57 tuah update.virus.scanners: Running autoupdate for clamav
Nov 14 20:06:01 tuah ClamAV-autoupdate[3220]: ClamAV updated
Nov 14 20:06:01 tuah update.virus.scanners: Found generic installed
Nov 14 20:06:01 tuah update.virus.scanners: Running autoupdate for generic
Nov 14 20:07:51 tuah MailScanner[2947]: MailScanner child caught a SIGHUP
Nov 14 20:07:51 tuah MailScanner[3070]: MailScanner child caught a SIGHUP
Nov 14 20:07:51 tuah MailScanner[2858]: MailScanner child caught a SIGHUP
Nov 14 20:07:51 tuah MailScanner[2794]: MailScanner child caught a SIGHUP
Nov 14 20:07:51 tuah MailScanner[2640]: MailScanner child caught a SIGHUP
Nov 14 20:07:52 tuah postfix/postfix-script: fatal: the Postfix mail system is not running
Nov 14 20:08:11 tuah postfix/postfix-script: fatal: the Postfix mail system is not running
Nov 14 20:08:12 tuah postfix/postfix-script: starting the Postfix mail system
Nov 14 20:08:12 tuah postfix/master[3746]: fatal: bind 192.168.0.3 port 25: Address already in use
Nov 14 20:08:52 tuah postfix/postfix-script: starting the Postfix mail system
Nov 14 20:08:52 tuah postfix/master[3888]: fatal: bind 192.168.0.3 port 25: Address already in use
Nov 14 20:08:56 tuah MailScanner[3908]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 20:08:56 tuah MailScanner[3908]: Read 848 hostnames from the phishing whitelist
Nov 14 20:08:57 tuah MailScanner[3908]: Read 6977 hostnames from the phishing blacklist
Nov 14 20:08:57 tuah MailScanner[3908]: SpamAssassin temporary working directory is /tmp
Nov 14 20:08:57 tuah MailScanner[3908]: Using SpamAssassin results cache
Nov 14 20:08:57 tuah MailScanner[3908]: Connected to SpamAssassin cache database
Nov 14 20:08:57 tuah MailScanner[3908]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 20:08:59 tuah MailScanner[3908]: Using locktype = flock
Nov 14 20:09:01 tuah MailScanner[3935]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 20:09:01 tuah MailScanner[3935]: Read 848 hostnames from the phishing whitelist
Nov 14 20:09:01 tuah MailScanner[3935]: Read 6977 hostnames from the phishing blacklist
Nov 14 20:09:02 tuah MailScanner[3935]: SpamAssassin temporary working directory is /tmp
Nov 14 20:09:02 tuah MailScanner[3935]: Using SpamAssassin results cache
Nov 14 20:09:02 tuah MailScanner[3935]: Connected to SpamAssassin cache database
Nov 14 20:09:02 tuah MailScanner[3935]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 20:09:03 tuah MailScanner[3935]: Using locktype = flock
Nov 14 20:09:06 tuah MailScanner[3942]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 20:09:06 tuah MailScanner[3942]: Read 848 hostnames from the phishing whitelist
Nov 14 20:09:07 tuah MailScanner[3942]: Read 6977 hostnames from the phishing blacklist
Nov 14 20:09:07 tuah MailScanner[3942]: SpamAssassin temporary working directory is /tmp
Nov 14 20:09:07 tuah MailScanner[3942]: Using SpamAssassin results cache
Nov 14 20:09:07 tuah MailScanner[3942]: Connected to SpamAssassin cache database
Nov 14 20:09:07 tuah MailScanner[3942]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 20:09:08 tuah MailScanner[3942]: Using locktype = flock
Nov 14 20:09:11 tuah MailScanner[3953]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 20:09:11 tuah MailScanner[3953]: Read 848 hostnames from the phishing whitelist
Nov 14 20:09:12 tuah MailScanner[3953]: Read 6977 hostnames from the phishing blacklist
Nov 14 20:09:12 tuah MailScanner[3953]: SpamAssassin temporary working directory is /tmp
Nov 14 20:09:12 tuah MailScanner[3953]: Using SpamAssassin results cache
Nov 14 20:09:12 tuah MailScanner[3953]: Connected to SpamAssassin cache database
Nov 14 20:09:12 tuah MailScanner[3953]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 20:09:13 tuah MailScanner[3953]: Using locktype = flock
Nov 14 20:09:16 tuah MailScanner[3958]: MailScanner E-Mail Virus Scanner version 4.72.5 starting…
Nov 14 20:09:16 tuah MailScanner[3958]: Read 848 hostnames from the phishing whitelist
Nov 14 20:09:17 tuah MailScanner[3958]: Read 6977 hostnames from the phishing blacklist
Nov 14 20:09:17 tuah MailScanner[3958]: SpamAssassin temporary working directory is /tmp
Nov 14 20:09:17 tuah MailScanner[3958]: Using SpamAssassin results cache
Nov 14 20:09:17 tuah MailScanner[3958]: Connected to SpamAssassin cache database
Nov 14 20:09:17 tuah MailScanner[3958]: Enabling SpamAssassin auto-whitelist functionality…
Nov 14 20:09:18 tuah MailScanner[3958]: Using locktype = flock
November 15th, 2008 at 1:00 pm
Hi Md,
Nov 14 19:56:46 tuah postfix/master[2614]: fatal: bind 192.168.0.3 port 25: Address already in use
Port 25 is already being used. You probably have another mail service running (ex. SendMail or Exim)
November 15th, 2008 at 5:48 pm
Thanks for the reply.
Problem solved.
The problem is in the master.cf
January 15th, 2009 at 2:28 am
ITS THE BEST TUTORIAL ABOUT INSTALL AND BASIC CONFIGURATION OF MAILSCANNER, CLAMAV AND POSTFIX THAT I HAD FOUND…!
CONGRATULATIONS..
THANKS A LOT…!
January 16th, 2009 at 4:29 am
Are mailscanner and amavis mutually exclusive pieces of software? Do you know any articles that explains how all these different scripts fit together? (razor, pyzor, amavis, spamassassin, etc). Also, are certain scripts known to be better than others, or is it a game of the more you have the better protected you are?
February 4th, 2009 at 11:50 pm
The installation all appears to have gone ok – no reds on restart or on boot of the computer – all files seem to be correctly configured and maillog seems to be clean….
However when i send an email it is not tagged with the “mailscanner scanned this item….” stuff.
Does this mean that it isn’t scanning it? The logs look like it’s working but is there any other way to coonfirm this. Email also sends/recieves without any issues.
Thank you for the excellent guide.
I have restored the orignal mailscanner.conf and modified the settings several times to verify i am using the settings that you give above.
I have also noted that there is a very slight delay when sending an email to yourself in squirrelmail now as if it is completing the scan loop and then being delivered.
Any help would be greatly appreciated.
————-
starting…
Feb 4 23:37:53 mail MailScanner[6056]: Read 849 hostnames from the phishing whitelist
Feb 4 23:37:53 mail MailScanner[6056]: Read 5085 hostnames from the phishing blacklist
Feb 4 23:37:53 mail MailScanner[6056]: Using SpamAssassin results cache
Feb 4 23:37:53 mail MailScanner[6056]: Connected to SpamAssassin cache database
Feb 4 23:37:53 mail MailScanner[6056]: Enabling SpamAssassin auto-whitelist functionality…
Feb 4 23:37:54 mail MailScanner[6056]: Using locktype = flock
Feb 4 23:37:58 mail MailScanner[6231]: MailScanner E-Mail Virus Scanner version 4.74.16 starting…
Feb 4 23:37:58 mail MailScanner[6231]: Read 849 hostnames from the phishing whitelist
Feb 4 23:37:58 mail MailScanner[6231]: Read 5085 hostnames from the phishing blacklist
Feb 4 23:37:58 mail MailScanner[6231]: Using SpamAssassin results cache
Feb 4 23:37:58 mail MailScanner[6231]: Connected to SpamAssassin cache database
Feb 4 23:37:58 mail MailScanner[6231]: Enabling SpamAssassin auto-whitelist functionality…
Feb 4 23:38:00 mail MailScanner[6231]: Using locktype = flock
Feb 4 23:38:03 mail MailScanner[6262]: MailScanner E-Mail Virus Scanner version 4.74.16 starting…
Feb 4 23:38:03 mail MailScanner[6262]: Read 849 hostnames from the phishing whitelist
Feb 4 23:38:03 mail MailScanner[6262]: Read 5085 hostnames from the phishing blacklist
Feb 4 23:38:03 mail MailScanner[6262]: Using SpamAssassin results cache
Feb 4 23:38:03 mail MailScanner[6262]: Connected to SpamAssassin cache database
Feb 4 23:38:03 mail MailScanner[6262]: Enabling SpamAssassin auto-whitelist functionality…
Feb 4 23:38:05 mail MailScanner[6262]: Using locktype = flock
Feb 4 23:38:42 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:38:42 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:38:43 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:38:43 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:38:44 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:38:44 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:38:58 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:38:58 mail postfix/pickup[5827]: C659FE6C692: uid=48 from=
Feb 4 23:38:58 mail postfix/cleanup[6556]: C659FE6C692: message-id=
Feb 4 23:38:59 mail postfix/qmgr[5828]: C659FE6C692: from=, size=699, nrcpt=1 (queue active)
Feb 4 23:38:59 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:38:59 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:38:59 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:38:59 mail postfix/local[6560]: C659FE6C692: to=, relay=local, delay=2.9, delays=2.5/0.17/0/0.18, dsn=2.0.0, status=sent (delivered to maildir)
Feb 4 23:38:59 mail postfix/qmgr[5828]: C659FE6C692: removed
Feb 4 23:39:02 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:39:02 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:39:04 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:39:04 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:39:05 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:39:05 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:40:13 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:40:13 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:43:42 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:43:42 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:43:59 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:43:59 mail postfix/pickup[5827]: 975F5E6C69F: uid=48 from=
Feb 4 23:43:59 mail postfix/cleanup[6836]: 975F5E6C69F: message-id=
Feb 4 23:43:59 mail postfix/qmgr[5828]: 975F5E6C69F: from=, size=713, nrcpt=1 (queue active)
Feb 4 23:43:59 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:43:59 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:43:59 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:43:59 mail postfix/local[6840]: 975F5E6C69F: to=, orig_to=, relay=local, delay=0.42, delays=0.21/0.18/0/0.03, dsn=2.0.0, status=sent (delivered to maildir)
Feb 4 23:43:59 mail postfix/qmgr[5828]: 975F5E6C69F: removed
Feb 4 23:44:02 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:44:02 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:44:04 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:44:04 mail dovecot: IMAP(mailtest): Disconnected: Logged out
Feb 4 23:44:09 mail dovecot: imap-login: Login: user=, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Feb 4 23:44:09 mail dovecot: IMAP(mailtest): Disconnected: Logged out
February 6th, 2009 at 1:23 pm
Hi Danny,
MailScanner is not working. You probably forgot to uncomment the header_checks in main.cf (step 1 of Integrating MailScanner into Postfix). This causes the mail to be delivered directly instead of going to the holding area first for scanning.
February 6th, 2009 at 3:13 pm
Thanks, I got it working only for a while, then after a few restarts all i get is kernel panics on boot.
I think i’m gonna format reinstall and start from the beginning again. At least i’m starting to memorise the files and settings i need to change.
Thanks again for your reply.
February 9th, 2009 at 11:30 am
Thanks for your help -unfortunately i may have found the source of several of the problems i’d worked through before i posted that.
I finally got it all working, only for the hard drive to corrupt entirely. Typical. (All in a days work though so more practice for me i guess) I’ll post again if the same problem occurs on my next try.
I can deifnately say though that header_checks was uncommented and the extra line added to the bottom of the header_checks file. Maybe it was an installation problem.
Thanks
March 8th, 2009 at 6:00 am
thanks for your great artical, it does help a lot!!!
thanks!! for your master piece!!!
May 26th, 2009 at 8:04 am
What does it mean the log
May 16 13:40:59 mail MailScanner[2567]: Enabling SpamAssassin auto-whitelist functionality…
May 16 13:41:04 mail MailScanner[2745]: Enabling SpamAssassin auto-whitelist functionality…
May 16 13:41:04 mail postfix/pickup[2277]: nss_ldap: failed to bind to LDAP server ldap://127.0.0.1/: Can’t contact LDAP server
May 16 13:41:04 mail postfix/pickup[2277]: nss_ldap: reconnecting to LDAP server (sleeping 32 seconds)…
May 16 13:41:04 mail postfix/qmgr[2278]: nss_ldap: failed to bind to LDAP server ldap://127.0.0.1/: Can’t contact LDAP server
May 16 13:41:04 mail postfix/qmgr[2278]: nss_ldap: reconnecting to LDAP server (sleeping 32 seconds)…
May 16 13:41:09 mail MailScanner[2830]: Enabling SpamAssassin auto-whitelist functionality…
May 16 13:41:10 mail postfix/proxymap[3601]: nss_ldap: failed to bind to LDAP server ldap://127.0.0.1/: Can’t contact LDAP server
May 16 13:41:10 mail postfix/proxymap[3601]: nss_ldap: reconnecting to LDAP server (sleeping 32 seconds)…
May 16 13:41:36 mail postfix/pickup[2277]: nss_ldap: failed to bind to LDAP server ldap://127.0.0.1/: Can’t contact LDAP server
May 16 13:41:36 mail postfix/pickup[2277]: nss_ldap: reconnecting to LDAP server (sleeping 64 seconds)…
May 16 13:41:36 mail postfix/qmgr[2278]: nss_ldap: failed to bind to LDAP server ldap://127.0.0.1/: Can’t contact LDAP server
May 16 13:41:36 mail postfix/qmgr[2278]: nss_ldap: reconnecting to LDAP server (sleeping 64 seconds)…
May 26th, 2009 at 8:06 am
My postfix doesn’t start on start up
June 1st, 2009 at 8:07 am
hey frenz…
i have configured my mail server from d given steps…bt all mah mails are stucked into /var/spool/postfix/hold
when going thru my /var/log/maillog
it gives d following info
Jun 1 12:22:18 localhost MailScanner[3878]: MailScanner E-Mail Virus Scanner version 4.76.25 starting…
Jun 1 12:22:18 localhost MailScanner[3878]: Read 853 hostnames from the phishing whitelist
Jun 1 12:22:18 localhost MailScanner[3878]: Read 10626 hostnames from the phishing blacklists
Jun 1 12:22:18 localhost MailScanner[3878]: Using SpamAssassin results cache
Jun 1 12:22:18 localhost MailScanner[3878]: Could not create SpamAssassin cache database /var/spool/MailScanner/incoming/SpamAssassin.cache.db
Jun 1 12:22:18 localhost MailScanner[3878]: Enabling SpamAssassin auto-whitelist functionality…
Jun 1 12:22:19 localhost MailScanner[3878]: Could not create processing-messages database “/var/spool/MailScanner/incoming/Processing.db”
Jun 1 12:22:19 localhost MailScanner[3878]: Using locktype = flock
June 1st, 2009 at 10:30 am
Resolved the problem with LDAP server.
I have now the same problem with the SATYAM ROHIT.
Jun 1 12:27:16 mail MailScanner[11981]: Enabling SpamAssassin auto-whitelist functionality…
Jun 1 12:27:18 mail MailScanner[11978]: Could not create processing-messages database “/var/spool/MailScanner/incoming/Processing.db”
Jun 1 12:27:18 mail MailScanner[11978]: Using locktype = flock
Jun 1 12:27:19 mail MailScanner[11989]: MailScanner E-Mail Virus Scanner version 4.76.25 starting…
Jun 1 12:27:20 mail MailScanner[11989]: Read 853 hostnames from the phishing whitelist
Jun 1 12:27:20 mail MailScanner[11989]: Read 6764 hostnames from the phishing blacklists
Jun 1 12:27:20 mail MailScanner[11989]: Using SpamAssassin results cache
Jun 1 12:27:20 mail MailScanner[11989]: Could not create SpamAssassin cache database /var/spool/MailScanner/incoming/SpamAssassin.cache.db
Jun 1 12:27:20 mail MailScanner[11989]: Enabling SpamAssassin auto-whitelist functionality…
Jun 1 12:27:24 mail MailScanner[11997]: MailScanner E-Mail Virus Scanner version 4.76.25 starting…
Jun 1 12:27:24 mail MailScanner[11997]: Read 853 hostnames from the phishing whitelist
Jun 1 12:27:25 mail MailScanner[11981]: Could not create processing-messages database “/var/spool/MailScanner/incoming/Processing.db”
Jun 1 12:27:25 mail MailScanner[11981]: Using locktype = flock
Jun 1 12:27:25 mail MailScanner[11997]: Read 6764 hostnames from the phishing blacklists
Jun 1 12:27:26 mail MailScanner[11997]: Using SpamAssassin results cache
Jun 1 12:27:26 mail MailScanner[11997]: Could not create SpamAssassin cache database /var/spool/MailScanner/incoming/SpamAssassin.cache.db
Jun 1 12:27:26 mail MailScanner[11997]: Enabling SpamAssassin auto-whitelist functionality…
Jun 1 12:27:27 mail MailScanner[11989]: Could not create processing-messages database “/var/spool/MailScanner/incoming/Processing.db”
Jun 1 12:27:27 mail MailScanner[11989]: Using locktype = flock
June 25th, 2009 at 5:52 pm
Hi, am trying to install the mail server following your guide step by step, the problem I have now is mails getting stuck in /var/spool/postfix/hold. I have check the mail log file I find the following errors
mailscanner[28068]: could not read directory Outgoing. Error in configuration file line 159, directory Outgoing Queue Dir=/var/spool/postfix/incoming for outqueuedir does not exist (or is not readable) I will apricate any help. Thanks
July 4th, 2009 at 3:26 am
I followed your instructions and now I see the following error in my maillog
You want to use SpamAssassin but have not installed it.
I fololowed your instructions and setup maiScanner, I thought it would use the spamassassion, yet i have not installed it
Do I need to install it ?
July 22nd, 2009 at 9:43 pm
“SpamAssassin is included in Red Hat Enterprise Linux 5 and CentOS 5 and it’s ready to go out of the box.”
Well, not in my case.
When looking in /var/log/maillog, I see this line:
Jul 22 15:21:17 nestorix spamd[2723]: dns: sendto() failed: Invalid argument at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/DnsResolver.pm line 395.
Anyone knows how to get rid of this?
Albert
July 26th, 2009 at 9:28 pm
Just wanted to thank you for a great set of instructions…. everything worked exactly untill I had to install the MailScanner. I had to use the ./install.sh after downloading the program from their website and then had a few false starts where I needed to install other things and then re-run ./install.sh…. I had to install clamav,clamd and clamdb from the Zag place… I got everything working from scratch on a fresh machine in around 12 hours… started installing on Centos 5 and ended up finishing on 5.03 when I could not get MailScanner to install, I updated Centos first….
Thanks again
August 27th, 2009 at 5:02 am
I can’t get postfix service to start again. Any idea what I may have done wrong
August 27th, 2009 at 7:13 am
Hi Scrouch,
Please check the log file at /var/log/maillog