一、安装procmail
1. 下载最新版 http://www.procmail.org
2. tar zxvf procmail
3. cd procmail-3.15.2
4. make install (解除安装make deinstall)
5. make install-suid (增加安全性) 检查一下/etc/sendmail.cf是否已将procmail替换原来的mail.local Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=10/30, R=20/40, A=procmail -Y -a $h -d $u
二、设定procmail
vi /etc/procmailrc MAILDIR=/var/mail VERBOSE=off PATH=/bin:/sbin:/usr/bin:/usr/sbin/:/usr/local/bin:/usr/local/sbin LOGFILE=/var/log/procmail.log #SirCam Virus :0 Bh *I send you this file in order to have your advice /dev/null #Nimda Virus :0 Bh * ^Content-Type: audio/x-wav; * name="readme.exe" /dev/null :0 Bh * ^Content-Type:.*audio/x-wav.* * name="sample.exe" /dev/null Procmail范例
将所有收到主旨有test字符的信放入/var/mail/IN.test档案中。
:0 b * ^Subject:.*test IN.test
参考静态病毒码
http://alcor.concordia.ca/topics/email/auto/procmail/spam/tag-contents.html
三、观察系统日志统计
mailstat -km procmail.log
- m 合并错误至同一行(会删除原记录,重新计算) - l 增加统计平均每人邮件大小,(会删除原记录,重新计算) - k 保持原来的log檔 - o 使用旧的统计数据文件 - t 没有总统计资料 |