MailScanner Problems with Perl on CentOS 5

A few weeks ago,I followed the excellent tutorial MailScanner,Postfix,ClamAV and SpamAssassin Setup Howto in RHEL/CentOS 4 and had a fully functional MailScanner setup on my CentOS 5 server.  Email was flowing from various blog sites that are hosted on the server,viruses were getting removed and spam was being blocked.  It was working!  And so I forgot all about email on the server,until a few days ago when I noticed that I hadn’t received any logwatc or cron emails for a while.  And so I plunged down the rabbit hole….

I found all the email in the Postfix directory /var/spool/Postfix/hold.  Hundreds of email.  I wanted that stuck email!   Dexter’s weblog has a great post on playing with the Postfix queue.  I ran ‘postqueue -p‘and all of the emails showed a ‘!’ character next to queue ID meaning that they were on hold.    Running ‘postsuper -H ALL‘released all the emails. So Postfix was working fine –it was delivering email to it’s hold directory and waiting for MailScanner to move the email from hold to the SpamAssassin queue.

Now I had emails to read but what was the cause of the problem?!?  I had hundreds of emails failing from some hourly cron.  It turned out that the check_MailScanner script was failing but not giving any errors.   So I wouldn’t receive an email every hour,I moved that script out of cron.hourly until the problem was resolved.  After some more Googling,I found two commands that are essential to resolving MailScanner problems:

  1. MailScanner –lint:  checks you MailScanner configuration.  I found two unrelated problems in my config files.
  2. MailScanner –debug –debug-sa:runs MailScanner with verbose output

Running ‘MailScanner –debug’showed a Perl dependency problem:

File::Temp version 0.18 required–this is only version 0.16 at /usr/lib/perl5/site_perl/5.8.8/MIME/Tools.pm line 14.
BEGIN failed–compilation aborted
at /usr/lib/perl5/site_perl/5.8.8/MIME/Tools.pm line 14.
Compilation failed in require
at /usr/lib/perl5/site_perl/5.8.8/MIME/Parser.pm line 142.
BEGIN failed–compilation aborted
at /usr/lib/perl5/site_perl/5.8.8/MIME/Parser.pm line 142.
Compilation failed in require
at /usr/lib/MailScanner/MailScanner/MCPMessage.pm line 41.
BEGIN failed–compilation aborted
at /usr/lib/MailScanner/MailScanner/MCPMessage.pm line 41.
Compilation failed in require at /usr/sbin/MailScanner line 81.
BEGIN failed–compilation aborted at /usr/sbin/MailScanner line 81.

Getting somewhere.  More Google searches uncovered a thread from a guy with the same problem.  The solution is to go back to the MailScanner source directory and run ‘./install.sh –reinstall‘  This seemed to clear up the perl-MIME problem. Running check_mailscanner returned process IDs:

MailScanner running with pid 22044 22045 22049 22058 22063 22065 22068

So email is flowing again. I moved the cron.hourly script back and it seemed to be happy.  But running yum update showed dependency problems with some Perl modules.  Ugh.  Some more Google noodling uncovered a post with the same issue.  The easiest way to resolve is to add

exclude=perl-*

to /etc/yum.repos.d/rpmforge.repo

And note to self,always run ‘newaliases‘after mucking with /etc/aliases!

Share

1 comment to MailScanner Problems with Perl on CentOS 5

  • Yeah,I used to run my own mail server too. RPM hell,bounced mail,backup mail servers,spam and grey listing…all too much of a pain. Instead I use big brother powered gmail. Ahhhh,so much simpler.
    That all said,nice write up! It’s always good to spread the good word of how you fixed your junk!

Leave a Reply

  

  

  

You can use these HTML tags

<a href=""title=""><abbr title=""><acronym title=""><b><blockquote cite=""><cite><code><del datetime=""><em><i><q cite=""><strike><strong>