Mailscanner/Exim Gateway With Communigate PRO Guide
Mailscanner/Exim Gateway With Communigate PRO GuideIn 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 for any other Linux based system with little modifications. The system will run with SELinux in enforcing mode. The components that we will use include:
Install PackagesI 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.
Exim
yum install exim -y
MailScanner
wget http://www.mailscanner.info/files/4/rpm/MailScanner-4.66.5-3.rpm.tar.gz
Clamav
yum install clamav clamav-db clamd -y
Sanesecurity Signatures
wget http://www.sanesecurity.co.uk/clamav/update_sanesecurity.txt -O /usr/local/bin/update_sanesecurity.sh
Apacheyum install httpd php php-mysql php-gd php-eaccelerator -y /sbin/chkconfig --level 345 httpd on
Spamassassinyum install spamassassin -y
Fuzzy OCR
yum install netpbm-progs ocrad gocr gifsicle giflib-utils giflib -y
Razoryum install razor-agents
MySQLyum install mysql mysql-server -y
Mailwatch
wget http://dfn.dl.sourceforge.net/sourceforge/mailwatch/mailwatch-1.0.4.tar.gz
Mailfeeder
wget http://www.pldaniels.com/mailfeeder/mailfeeder-0.2.3.tar.gz
Configure PackagesConfigure EximIntroductionTo run exim with mailscanner you need 2 configuration files one for the daemon that will listen on port 25 and accept incoming mail and another for the exim process that will deliver the clean mail that has been scanned by mailscanner. You also require 2 queues one for incoming and the other for clean mail that has been scanned. I will not dwell on all the configuration options that exim provides i expect that you will be able to get detailed info else where on how to configure an normal running exim system so i will only focus on those areas that are specific to this setup.
cp /etc/exim/exim.conf /etc/exim/exim.conf.orig
Inbound EximThis is the configuration for the exim daemon that listens on port 25 and accepts the messages and queues them for mailscanner to process. The configuration file is /etc/exim/exim.conf.
Anti-virus / Sanesecurity ChecksConfigure the incoming exim daemon (/etc/exim/exim.conf) to use clamav to scan incoming mail and reject virus infected email and image and pdf spam at smtp time. av_scanner = clamd:/var/run/clamav/clamd.sock
Mail RoutingConfigure the domains you accept mail for, we will add these to a file /etc/exim/relay_domains. # example /etc/exim/relay_domains example.com Specify this in the exim configuration: domainlist relay_to_domains = lsearch;/etc/exim/relay_domains Configure the routing of the domains you are filtering mail for in the file /etc/exim/mail-routes. #example /etc/exim/mail-routes example.com: xxx.xxx.xxx.xxx:xxx.xxx.xxx.xxx #this domain is on a CGP cluster of 2 front end nodes somedomain.com: xxx.xxx.xxx.xxx # this delivers to one CGP machine Configure a router to accept mail for the relay domains. You need to add this under the check_backend: router (see address verification below). deliver_clean:
driver = manualroute
domains = +relay_to_domains
transport = remote_smtp
route_data = ${lookup{$domain}lsearch{/etc/exim/mail-routes}}
Mailscanner IntergrationConfigure the inbound exim just to queue the messages and not deliver to enable mailscanner to process them. spool_directory = /var/spool/exim.in process_log_path = /var/spool/exim/exim-process.info queue_only = true queue_only_override = false
RBL'sConfigure the RBL's under acl_check_rcpt: drop message = REJECTED because $sender_host_address is in a black list spamhaus.org
dnslists = xen.spamhaus.org
drop message = REJECTED because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
dnslists = bl.spamcop.net
drop message = REJECTED because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
dnslists = dnsbl.sorbs.net
|



Recent comments
1 day 8 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 13 hours ago
1 day 15 hours ago
1 day 16 hours ago
1 day 18 hours ago
2 days 10 hours ago
2 days 10 hours ago
2 days 14 hours ago