开源软件中最好的内容过滤程序,做内容过滤的必选。
shell
修改local.cf文件:
shell
内容如下:
report_safe 1 use_bayes 0
使用Chinese_rules.cf fetch得到这个规则后可以看到,他从2006年10月2日以来,都没有再更新过了,因此是否仍然使用该规则取决于您自己。如果仍然想继续使用,按照如下的操作即可。 -rw-r–r– 1 root wheel 55342 Oct 2 2006 Chinese_rules.cf
shell
内容如下:
#!/bin/sh cd /tmp/ fetch -q http://www.ccert.edu.cn/spam/sa/Chinese_rules.cf mv Chinese_rules.cf /usr/local/share/spamassassin/ /usr/local/etc/rc.d/amavisd forcerestart > /dev/null
增加执行权限
shell
定期执行sa.sh脚本:
shell
增加一行如下,每周6执行一次:
0 0 * * 6 root /var/cron/sa.sh
测试杀毒/内容过滤 测试杀毒。在做该测试之前,你需要确保你的clamd,amavisd,postfix都正常启动。可以通过如下脚本来启动他们。
shell
shell
# telnet localhost 25
其过程如下:
Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. 220 mail.extmail.org ESMTP Postfix helo mail.extmail.org << 输入内容 250 mail.extmail.org mail from:<postmaster@extmail.org> << 输入内容 250 2.1.0 Ok rcpt to:<test@extmail.org> << 输入内容 250 2.1.5 Ok data << 输入内容 354 End data with . X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* << 输入内容 . << 输入内容 250 2.0.0 Ok: queued as BC24E85260 quit << 输入内容 221 2.0.0 Bye Connection closed by foreign host.
maillog中出现类似如下日志则说明clamav和amavid-new正常工作
Feb 16 17:26:30 mail amavis[1498]: (01498-01) Blocked INFECTED (Eicar-Test-Signature), MYNETS LOCAL [127.0.0.1] [127.0.0.1] <postmaster@extmail.org> -> <test@extmail.org>, quarantine: virus-iyqHp+MsEJkS, Message-ID: <20110216092625.A6B1E52@mail.extmail.org>, mail_id: iyqHp+MsEJkS, Hits: -, size: 406, 1532 ms