qmail antivirus antispam

1. 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 maildrop­man­2.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 qmail­scanner
edit /etc/tcp.smtp, add following lines
# No Qmail­Scanner at all for mail from 127.0.0.1
127.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail­-queue"
# Use Qmail­Scanner without SpamAssassin on any mail from the local network
192.168.:allow,RELAYCLIENT="",RBLSMTPD="",QMAILQUEUE="/var/qmail/bin/qmail-scanner­-queue.pl"
# Use Qmail­Scanner with SpamAssassin on any mail from the rest of the world
:allow,QMAILQUEUE="/var/qmail/bin/qmai-l­scanner­-queue.pl"
qmailctl cdb
qmailctl restart

--知行合一

Posted in 标签: |

0 评论: