MailScanner is an open source anti-virus and anti-spam filter for email servers. The anti-virus and anti-spam portion is delegated to third party applications. This article describes how to install MailScanner.

The installation requires some packages found in RPMforge so make sure it is available in your system. Learn how to add the RPMforge repository.Getting MailScanner


1. Click the globe icon at the top near the System menu to launch the Firefox web browser.
If an error occurs, you probably did not install the Graphical Internet package. You can add it now using the Package Manager tool.

2. In the address box, type in http://www.mailscanner.info/downloads.html and press Enter. Download the stable version for RedHat, Fedora and Mandrake Linux.Installing MailScanner

1. The MailScanner source code should now be on your desktop. Right click the newly downloaded file and click Extract Here.
2. After extracting, a MailScanner folder should be found on your Desktop. Right click the MailScanner folder and click Open in Terminal.
3. In the terminal window, type in all the command below (in one line) to install the required Perl modules from the RPMforge repository.
yum install perl-Archive-Zip perl-DBD-SQLite perl-Filesys-Df perl-Net-CIDR perl-OLE-Storage_Lite perl-Sys-Hostname-Long

4. Finally, type in the command below to install MailScanner.
yum localinstall --nogpgcheck mailscanner*
«« Previous: How to Configure the Firewall
Next: How to Install Clam AntiVirus »»
Visit the forum to ask for help or to give a comment.
***
Posted on 4/23/2007 and last updated on 11/7/2009
Filed under CentOS 5 , MailScanner , Red Hat Enterprise Linux 5
January 26th, 2008 at 6:52 am
On CentOS5.1 I had to install rpm-build first. I had to open a terminal window and navigate to MailScanner-4.66.5-3 on the desktop and run ./install.sh to find this out – if done by the method above, the terminal window just opens and closes in under a second and you miss the error message.
On a Pentium 4 3GHz the MailScanner build ran about 15 minutes.
March 24th, 2008 at 8:43 am
Good. You have the patch command.
Good, you have /usr/src/redhat in place.
You are running release 5 of RedHat, or a clone.
So I will only force the installation of a very few Perl modules.
Good, unpackaged files will not break the build process.
Good, far-too-clever Perl requirements will be ignored.
Good, Fedora 8 options will be ignored.
Good, you appear to only have 1 copy of Perl installed.
I think you are running on RedHat Linux, Mandriva Linux or SuSE Linux.
Good, you appear to have the basic development tools installed.
This script will pause for a few seconds after each major step,
so do not worry if it appears to stop for a while.
If you want it to stop so you can scroll back through the output
then press Ctrl-S to stop the output and Ctrl-Q to start it again.
If this fails due to dependency checks, and you wish to ignore
these problems, you can run
./install.sh nodeps
Setting Perl5 search path
I think your system will build architecture-dependent modules for i386
Rebuilding all the Perl RPMs for your version of Perl
Oh good, module File::Spec version 0.82 is already installed.
Attempting to build and install perl-ExtUtils-MakeMaker-6.32-1
Installing perl-ExtUtils-MakeMaker-6.32-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-ExtUtils-MakeMaker-6.32-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-ExtUtils-MakeMaker-6.32-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Net-CIDR-0.11-1
Installing perl-Net-CIDR-0.11-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Net-CIDR-0.11-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Net-CIDR-0.11-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-IO-stringy-2.110-1
Installing perl-IO-stringy-2.110-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-IO-stringy-2.110-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-IO-stringy-2.110-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-MIME-Base64-3.07-1
Installing perl-MIME-Base64-3.07-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-MIME-Base64-3.07-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/i386/perl-MIME-Base64-3.07-1.i386.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-TimeDate-1.16-3
Installing perl-TimeDate-1.16-3.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-TimeDate-1.16-3.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-TimeDate-1.16-3.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Pod-Escapes-1.04-1
Installing perl-Pod-Escapes-1.04-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Pod-Escapes-1.04-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Pod-Escapes-1.04-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Pod-Simple-3.05-1
Installing perl-Pod-Simple-3.05-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Pod-Simple-3.05-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Pod-Simple-3.05-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Test-Pod-1.26-1
Installing perl-Test-Pod-1.26-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Test-Pod-1.26-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Test-Pod-1.26-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-MailTools-2.02-1
Installing perl-MailTools-2.02-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-MailTools-2.02-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-MailTools-2.02-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-IO-1.2301-1
Installing perl-IO-1.2301-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-IO-1.2301-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-IO-1.2301-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-File-Temp-0.19-1
Installing perl-File-Temp-0.19-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-File-Temp-0.19-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-File-Temp-0.19-1.noarch.rpm.
Maybe it did not build correctly?
Oh good, module HTML::Tagset version 3.03 is already installed.
Attempting to build and install perl-HTML-Parser-3.56-1
Installing perl-HTML-Parser-3.56-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-HTML-Parser-3.56-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/i386/perl-HTML-Parser-3.56-1.i386.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Convert-BinHex-1.119-2
Installing perl-Convert-BinHex-1.119-2.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Convert-BinHex-1.119-2.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Convert-BinHex-1.119-2.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-MIME-tools-5.425-1
Installing perl-MIME-tools-5.425-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-MIME-tools-5.425-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-MIME-tools-5.425-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Convert-TNEF-0.17-1
Installing perl-Convert-TNEF-0.17-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Convert-TNEF-0.17-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Convert-TNEF-0.17-1.noarch.rpm.
Maybe it did not build correctly?
Oh good, module Compress::Zlib version 1.41 is already installed.
Attempting to build and install perl-Archive-Zip-1.16-1
Installing perl-Archive-Zip-1.16-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Archive-Zip-1.16-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Archive-Zip-1.16-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Scalar-List-Utils-1.19-1
Installing perl-Scalar-List-Utils-1.19-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Scalar-List-Utils-1.19-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Scalar-List-Utils-1.19-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Storable-2.16-1
Installing perl-Storable-2.16-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Storable-2.16-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Storable-2.16-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-DBI-1.56-1
Installing perl-DBI-1.56-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-DBI-1.56-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-DBI-1.56-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-DBD-SQLite-1.13-1
Installing perl-DBD-SQLite-1.13-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-DBD-SQLite-1.13-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-DBD-SQLite-1.13-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Getopt-Long-2.36-1
Installing perl-Getopt-Long-2.36-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Getopt-Long-2.36-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Getopt-Long-2.36-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Time-HiRes-1.9707-1
Installing perl-Time-HiRes-1.9707-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Time-HiRes-1.9707-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Time-HiRes-1.9707-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Filesys-Df-0.90-1
Installing perl-Filesys-Df-0.90-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Filesys-Df-0.90-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Filesys-Df-0.90-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Test-Harness-2.64-1
Detected Compress-Zlib, building appropriately…
Installing perl-Test-Harness-2.64-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Test-Harness-2.64-1.src.rpm cannot be installed
Missing file /usr/src/redhat/RPMS/noarch/perl-Test-Harness-2.64-1.noarch.rpm.
Maybe it did not build correctly?
Attempting to build and install perl-Test-Simple-0.70-1
Detected Compress-Zlib, building appropriately…
Installing perl-Test-Simple-0.70-1.src.rpm
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
error: perl-Test-Simple-0.70-1.src.rpm cannot be installed
please help… thnx
March 24th, 2008 at 10:07 am
You need to logon as root to install MailScanner.
April 2nd, 2008 at 9:45 am
hello,
How to use “Fedora 8 options”? Is there any documentation?
thank you in advance.
regards,
Z
May 9th, 2008 at 7:08 am
It has started too well, but taking too much of time. I had to stop the process as it may be running in a loop after waiting for 15-20 minutes. Is this timing is OK or i m getting unneccessarily impatient?
thanks in advance,
shyam
May 9th, 2008 at 1:21 pm
I think you’ve been impatient. It really takes a while to build MailScanner. I wish a prebuilt binary is available similar to ClamAV but I can’t find any.
August 19th, 2008 at 5:33 pm
I am running Cent-OS 4.6. I really do not know a lot about Linux, but know enough that I want to stop over 100 spam per day.
If the process fails anyplace along the line, can I just re-run the install process? Will I need certain C libraries? And, does Postfix need to be running for this?
I’m not really sure what to ask before install attempt.
Much thanks!
August 19th, 2008 at 8:53 pm
Hi Art,
“If the process fails anyplace along the line, can I just re-run the install process?”
You can but you don’t have to. Setting this up only needs editing a few configuration files.
“Will I need certain C libraries?”
No. As long as you have a C compiler, you’re good to go.
“And, does Postfix need to be running for this?”
Yes. If you have an existing mail server, you can configure Postfix to be a mail gateway. Add greylisting to Postfix via Postgrey, this will really kill the spam.
If setting up the above looks complicated, I suggest you look at
Barracuda Spam Firewall
December 1st, 2008 at 2:08 pm
So I’ve troubles like Froylan^
…
Missing file /usr/src/redhat/RPMS/noarch/perl-Time-HiRes-1.9707-1.noarch.rpm.
Maybe it did not build correctly?
…
What else we need to properly install MailScanner?
Install all modules by hands!?
December 1st, 2008 at 2:22 pm
Sorry! I did not have rpm-build installed…
March 14th, 2009 at 9:47 pm
I installed it on centos 5 .
you will need rpm-build installed. otherwise the messages like ” Froylan” got.
and make sure the redhat directories are made, just start the install and it will complain about it.
/martin
May 3rd, 2009 at 6:32 pm
Howdy.
Great site, thanks a lot!
One question though, after installing MailScanner (and having the install script uninstall and build several perl modules), yum update fails (on those perl modules). Did I miss something? Is that expected, or is there a work around?
Cheers
May 3rd, 2009 at 6:47 pm
please post which modules are failed ?
May 3rd, 2009 at 6:52 pm
Ahhh, I see what happened there. I still had the rpmforge repo enabled, so that’s what was in conflict. I can’t remember if you suggested to use yum-priorities in your OS build docs, but if you did, you may want to add a note about an exclude=perl* statement to the rpmforge/dag repo after adding the it for clamv
May 3rd, 2009 at 6:53 pm
whoops, typo .. “add a note about an exclude=perl* statement to the rpmforge/dag repo after adding it for clamv”
May 3rd, 2009 at 6:58 pm
FYI: error before adding exclude param to rpmforge repo [the fomatting of this is going to be ugly, sorry]:
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
perl-Compress-Zlib i386 1.42-1.fc6 base 52 k
perl-Convert-TNEF noarch 0.17-3.2.el5.rf rpmforge 18 k
perl-DBD-SQLite i386 1.25-1.el5.rf rpmforge 745 k
perl-Digest-HMAC noarch 1.01-15 base 12 k
perl-Filesys-Df i386 0.92-1.el5.rf rpmforge 35 k
perl-HTML-Tagset noarch 3.10-2.1.1 base 15 k
perl-Math-BigInt noarch 1.89-1.el5.rf rpmforge 174 k
perl-Math-BigRat noarch 0.22-1.el5.rf rpmforge 30 k
perl-Net-IP noarch 1.25-2.fc6 base 31 k
perl-OLE-Storage_Lite noarch 0.17-1.el5.rf rpmforge 21 k
perl-Test-Harness noarch 3.14-1.el5.rf rpmforge 251 k
perl-TimeDate noarch 1:1.16-5.el5 base 32 k
perl-bignum noarch 0.23-1.el5.rf rpmforge 40 k
Transaction Summary
================================================================================
Install 0 Package(s)
Update 13 Package(s)
Remove 0 Package(s)
Total download size: 1.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/13): perl-Digest-HMAC-1.01-15.noarch.rpm | 12 kB 00:00
(2/13): perl-HTML-Tagset-3.10-2.1.1.noarch.rpm | 15 kB 00:00
(3/13): perl-Convert-TNEF-0.17-3.2.el5.rf.noarch.rpm | 18 kB 00:00
(4/13): perl-OLE-Storage_Lite-0.17-1.el5.rf.noarch.rpm | 21 kB 00:01
(5/13): perl-Math-BigRat-0.22-1.el5.rf.noarch.rpm | 30 kB 00:00
(6/13): perl-Net-IP-1.25-2.fc6.noarch.rpm | 31 kB 00:00
(7/13): perl-TimeDate-1.16-5.el5.noarch.rpm | 32 kB 00:00
(8/13): perl-Filesys-Df-0.92-1.el5.rf.i386.rpm | 35 kB 00:00
(9/13): perl-bignum-0.23-1.el5.rf.noarch.rpm | 40 kB 00:00
(10/13): perl-Compress-Zlib-1.42-1.fc6.i386.rpm | 52 kB 00:00
(11/13): perl-Math-BigInt-1.89-1.el5.rf.noarch.rpm | 174 kB 00:02
(12/13): perl-Test-Harness-3.14-1.el5.rf.noarch.rpm | 251 kB 00:01
(13/13): perl-DBD-SQLite-1.25-1.el5.rf.i386.rpm | 745 kB 00:01
——————————————————————————–
Total 110 kB/s | 1.4 MB 00:13
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Check Error:
file /usr/share/man/man3/bigint.3pm.gz from install of perl-bignum-0.23-1.el5. rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i386
file /usr/share/man/man3/bignum.3pm.gz from install of perl-bignum-0.23-1.el5. rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i386
file /usr/share/man/man3/bigrat.3pm.gz from install of perl-bignum-0.23-1.el5. rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i386
file /usr/bin/prove from install of perl-Test-Harness-3.14-1.el5.rf.noarch con flicts with file from package perl-5.8.8-18.el5_3.1.i386
file /usr/share/man/man1/prove.1.gz from install of perl-Test-Harness-3.14-1.e l5.rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i386
file /usr/share/man/man3/Test::Harness.3pm.gz from install of perl-Test-Harnes s-3.14-1.el5.rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i3 86
file /usr/share/man/man3/Math::BigFloat.3pm.gz from install of perl-Math-BigIn t-1.89-1.el5.rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i3 86
file /usr/share/man/man3/Math::BigInt.3pm.gz from install of perl-Math-BigInt- 1.89-1.el5.rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i386
file /usr/share/man/man3/Math::BigInt::Calc.3pm.gz from install of perl-Math-B igInt-1.89-1.el5.rf.noarch conflicts with file from package perl-5.8.8-18.el5_3. 1.i386
file /usr/share/man/man3/Math::BigInt::CalcEmu.3pm.gz from install of perl-Mat h-BigInt-1.89-1.el5.rf.noarch conflicts with file from package perl-5.8.8-18.el5 _3.1.i386
file /usr/share/man/man3/Math::BigRat.3pm.gz from install of perl-Math-BigRat- 0.22-1.el5.rf.noarch conflicts with file from package perl-5.8.8-18.el5_3.1.i386
May 3rd, 2009 at 7:02 pm
Sorry, last post, I swear ..
Just had a thought, instead of exclude=perl*, you could instead add an includ=clam* clause to the rpmforge repo so that only the clamav packages would be updated via yum ..
That’s it .. I hope
Cheers mate, wicked site you put together here
June 13th, 2009 at 4:31 am
Hi vk,
Thank you very much for your inputs. I have updated this article thanks to your comments. Here are the changes.
1. The RPMforge repository is very compatible with RHEL/CentOS so I am now using those instead of the packages included with MailScanner.
2. I rewrote the RPMforge repository installation to include prioritization.
3. I am now using the binary rpm package in MailScanner which means
- Installation is now instantenous
- Development tools are no longer required to be installed
- Perl conflicts has been eliminated
- It works with CentOS 5.3 fresh install. The old method wasn’t working, there was an error on perl-MIME-tools that I cannot fix.