In this tutorial we will be installing and setting up Mailscanner as a mail firewall in front of a Communigate pro cluster. This tutorial has been written for the CENTOS 5.x Linux distro but am sure it can be used of any other Linux based systems with little modification. The system will run with selinux in enforcing mode. The components that we will use include:
I assume that you have installed a bare bores CENTOS 5 system with the “Development Tools” group to work with so i will not go much into issues such as package selection and partition layout. As we will need to install certain software that is not part of the default CENTOS bases, we need to configure the system to use Dag Wieers rpm repo as he does package lots of software that we need.
# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
With that done we have configured the system to use the rpmforge repo.
For this tutorial the working directory will be /usr/local/src all downloads should be downloaded to and extracted in there
# yum install exim -y # /usr/sbin/alternatives --set mta /usr/sbin/sendmail.exim # service sendmail stop # /sbin/chkconfig --level 345 sendmail off # /sbin/chkconfig --level 345 exim on
# wget http://www.mailscanner.info/files/4/rpm/MailScanner-4.66.5-3.rpm.tar.gz # tar xzvf MailScanner-4.66.5-3.rpm.tar.gz # cd MailScanner-4.66.5-3 # ./install.sh
# yum install clamav clamav-db clamd -y # freshclam
# wget http://www.sanesecurity.co.uk/clamav/update_sanesecurity.txt -O /usr/local/bin/update_sanesecurity.sh # chmod +x /usr/local/bin/update_sanesecurity.sh # ln -s /usr/local/bin/update_sanesecurity.sh /etc/cron.hourly/ # /usr/local/bin/update_sanesecurity.sh
# yum install httpd php php-mysql php-gd php-eaccelerator -y # /sbin/chkconfig --level 345 httpd on
# yum install spamassassin -y
# yum install netpbm-progs ocrad gocr gifsicle giflib-utils giflib -y
# svn co https://svn.own-hero.net/fuzzyocr/trunk/devel/
# cd devel/
# perl -MCPAN -e 'install String::Approx'
# perl -MCPAN -e 'install Time::HiRes'
# perl -MCPAN -e 'install Log::Agent'
# cp -rv {FuzzyOcr.cf,FuzzyOcr.scansets,FuzzyOcr.preps,FuzzyOcr.pm,FuzzyOcr.words,FuzzyOcr/} /etc/mail/spamassassin
# chcon -R system_u:object_r:etc_mail_t /etc/mail/spamassassin/{FuzzyOcr.cf,FuzzyOcr.scansets,FuzzyOcr.preps,FuzzyOcr.pm,FuzzyOcr.words,FuzzyOcr/}
# wget http://www.gbnetwork.co.uk/mailscanner/FuzzyOcr.words -O /etc/mail/spamassassin/FuzzyOcr.words
# yum install razor-agents
# yum install mysql mysql-server -y
# wget http://dfn.dl.sourceforge.net/sourceforge/mailwatch/mailwatch-1.0.4.tar.gz
# tar xzvf mailwatch-1.0.4.tar.gz
# cd mailwatch-1.0.4
# cp -av mailscanner/* /var/www/html/
# cp /var/www/html/conf.php.example /var/www/html/conf.php
# mkdir /var/www/html/temp
# chmod u+rwx /var/www/html/temp
# rm -f /var/www/html/{index.php,xmlrpc,jpgraph,fpdf}
# cp /var/www/html/status.php /var/www/html/index.php
# mv /var/www/html/jpgraph-1.12.1 /var/www/html/jpgraph
# mv /var/www/html/fpdf152 /var/www/html/fpdf
# mv /var/www/html/xmlrpc_1.2 /var/www/html/xmlrpc
# chown apache.apache -R /var/www/html/
# chmod ug+rwx /var/www/html/images
# chmod ug+rwx /var/www/html/images/cache
# chcon -R system_u:object_r:httpd_sys_content_t /var/www/html/
# cp MailWatch.pm /usr/lib/MailScanner/MailScanner/CustomFunctions/
# cp SQLBlackWhiteList.pm /usr/lib/MailScanner/MailScanner/CustomFunctions/
# cp tools/db_clean.php /usr/local/bin/
# cp tools/quarantine_maint.php /usr/local/bin/
# wget http://www.pldaniels.com/mailfeeder/mailfeeder-0.2.3.tar.gz # tar xzvf mailfeeder-0.2.3.tar.gz # cd mailfeeder-0.2.3 # make # cp mailfeeder /usr/local/bin/