qmail antivirus antispam
Posted On 2008年11月8日星期六 at 时间: 22:34:00 by David Lu1. Installing spamassassin
yum install spamassassin -y
wget http://www.ccert.edu.cn/spam/sa/Chinese_rules.cf -P /usr/share/spamassassin
chkconfig spamassassin on
service spamassassin start
2. Installing clamav
useradd -s /bin/false clamav
tar zxf clamav-0.94rc1.tar.gz
cd clamav-0.94rc1
./configure
make; make install
cp contrib/init/RedHat/clamd /etc/init.d
edit /usr/local/etc/clamd.conf and freshclam.log, comment “Example”
freshclam
chkconfig clamd on
service clamd start
3. Installing MDA
rpm -i maildrop-2.0.4-1.5Server.i386.rpm
rpm -i maildrop-devel-2.0.4-1.5Server.i386.rpm
rpm -i maildropman2.0.4-1.5Server.i386.rpm
4. Installing perl modules
tar zxf Time-HiRes-1.9715.tar.gz
cd Time-HiRes-1.9715; perl Makefile.pl; make; make install
tar zxf DB_File-1.817.tar.gz
cd DB_File-1.817; perl Makefile.pl; make; make install
tar zxf Sys-Syslog-0.26.tar.gz
cd Sys-Syslog-0.26; perl Makefile.pl; make; make install
tar zxf MIME-Base64-3.07.tar.gz
cd MIME-Base64-3.07; perl Makefile.pl; make; make install
5. Optional
tar zxf tnef-1.4.4.tar.gz
cd tnef-1.4.4; ./configure; make; make install
yum install sharutils unzip -y
6. Installing qmail-scanner
tar zxf qmail-scanner-2.05.tgz
cd qmail-scanner-2.05
./configure --admin test --domain example.com --unzip yes --no-QQ-check --qmail-queue-binary /var/qmail/bin/qmail-queue
./configure --admin test --domain example.com --unzip yes --no-QQ-check --qmail-queue-binary /var/qmail/bin/qmail-queue --install
/var/qmail/bin/qmail-scanner-queue.pl -g
7. Integration qmail and qmailscanner
edit /etc/tcp.smtp, add following lines
# No QmailScanner at all for mail from 127.0.0.1
127.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-queue"
# Use QmailScanner without SpamAssassin on any mail from the local network
192.168.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"
# Use QmailScanner with SpamAssassin on any mail from the rest of the world
:allow,QMAILQUEUE="/var/qmail/bin/qmai-lscanner-queue.pl"
qmailctl cdb
qmailctl restart
--知行合一