根据网上的文章设置如下:
vi /etc/amavisd.conf
read_hash(\%whitelist_sender, '/var/spool/vscan/.spamassassin/whitelist');
read_hash(\%blacklist_sender, '/var/spool/vscan/.spamassassin/blacklist');
添加以上2句。
touch /var/spool/vscan/.spamassassin/whitelist
touch /var/spool/vscan/.spamassassin/blacklist
chown amavis:amavis /var/spool/vscan/.spamassassin/whitelist
chown amavis:amavis /var/spool/vscan/.spamassassin/blacklist
vi /var/spool/vscan/.spamassassin/whitelist
test.com.cn
test2.com
test3.com
vi /var/spool/vscan/.spamassassin/blacklist
***.com
/etc/rc.d/init.d/amavisd reload
Reloading Mail Virus Scanner (amavisd): Daemon [3009] terminated by SIGTERM, waiting for dust to settle...
becoming a new daemon...
成功!
根据实际的测试:
上述的设置在extmail1.1.0版本中,由于系统采用了slcokd 跟 amavisd调用spamassassin,spamassassin使用了dspam插件(注dspam的黑名单跟白名单是逐步学习的,数据记录在mysql中)。
vi /etc/amavisd.conf
@spam_scanners = (
['DSPAM', 'Amavis::SpamControl::ExtProg', $dspam,
[ qw(--client --stdout --deliver=spam,innocent --mode=teft --user extmail)],
],
['SpamAssassin', 'Amavis::SpamControl::SpamAssassin'],
);
而垃圾邮件丢到每个用户的垃圾箱,是使用的maildrop
vi /etc/maildroprc
DECODER="/var/www/extsuite/extmail/tools/decode -v"
if ((/^(From|Sender|Return-Path):.*MAILER\-DAEMON/))
{
BADSENDER=1
}
# Custom filter and auto deliver to Junk mailbox support
# need test command and other Unix command
`test -f $HOME/.mailfilter && exit 1 || exit 0`
# No customize filtering rules
if ( $RETURNCODE == 0 )
{
if (/^X-Spam-Flag:.*YES/ || /^X-DSPAM-Result:.*Spam/)
{
exception {
to "$HOME/Maildir/.Junk/."
}
}
}
这个过程就是使用的dspam打标的。
而我们使用
vi /etc/amavisd.conf
read_hash(\%whitelist_sender, '/var/spool/vscan/.spamassassin/whitelist');
read_hash(\%blacklist_sender, '/var/spool/vscan/.spamassassin/blacklist');
这个过程就跳过了dspam的检测。所以如果设置了/var/spool/vscan/.spamassassin/whitelist就跳过了打标的过程。在dspam的web站点中,不会有这个信件的记录。
同样,对应于/var/spool/vscan/.spamassassin/blacklist,也不会产生dspam的记录。
就都不会存在if (/^X-Spam-Flag:.*YES/ || /^X-DSPAM-Result:.*Spam/)这个判断了。就都跳过了maildrop。不会进垃圾箱。所以这里起作用的就是白名单,黑名单暂时无效!
除非去配置
$spam_quarantine_to = "spam\@$mydomain";
等相关参数。
所以我的设置是:
vi /var/spool/vscan/.spamassassin/whitelist
里面设置了本地虚拟域名,跟联系比较多的客户单位的邮件域名。
格式:
test.com.cn
test2.com
然后
/etc/rc.d/init.d/amavisd restart
这样就不会应该垃圾邮件打分,把本地域名跟重要客户的邮件,放到用户的垃圾箱了。
对于垃圾邮件,就使用dspam的自动学习,自己到web站点上去,做dspam的训练吧!!
阅读(3808) | 评论(1) | 转发(0) |