用 opendns 加 spamcop.net 实现对垃圾邮件的智能过滤

SpamAssassin
Image via Wikipedia

用 SpamAssassin 来过滤垃圾邮件是一种邮件收到以后的评分技术,然后根据分值,加上 procmail 之类的处理来判断是否丢弃邮件。在检查公司的 DNS 查询记录时发现,Ironport 大量查询类似 75.221.17.116.bl.spamcop.net 的域名地址,去 spamcop.net 查看,原来已经被 Ironport 收编。怪不得!

基于对 Ironport 的信任,决定在自己的 sendmail 服务器上应用这项技术。但是,刚开始时不成功,终于发现是使用的 DNS 服务器无论是电信还是网通的地址都是被劫持,这样的话,所有不能被解析的地址都返回一个固定的 IP ,导致 RBL 认为所有的 IP 都是 RBL 。

决定采用 OpenDNS 的服务器地址,修改 /etc/resolv.conf:

; OpenDNS
nameserver 208.67.222.222
nameserver 208.67.220.220

经过这样的修改之后,系统能自动识别在 RBL 中的 IP ,在邮件进入系统之前就被屏蔽,主要表现是客户端发送垃圾邮件时,被告知553 错误:

553 5.3.0 Spam blocked see: http://spamcop.net/bl.shtml?119.123.132.154

#tail -f /var/log/maillog

May 17 22:47:15 freelamp sendmail[20285]: ruleset=check_relay, arg1=cpe-69-206-174-116.hvc.res.rr.com, arg2=127.0.0.2, relay=cpe-69-206-174-116.hvc.res.rr.com [69.206.174.116], reject=553 5.3.0 Spam blocked see: http://spamcop.net/bl.shtml?69.206.174.116/bl.shtml?116.46.167.91

实施这个技术以后,能大幅减少系统的垃圾邮件数量,减轻后续的邮件过滤压力, 唯一增加的 overhead 是额外的 DNS 查询。

Reblog this post [with Zemanta]

Post to Twitter

相关文章

You can leave a response, or trackback from your own site.

One Response to “用 opendns 加 spamcop.net 实现对垃圾邮件的智能过滤”

  1. [...] 2.2 DCC_CHECK Listed in DCC (http://rhyolite.com/anti-spam/dcc/) 加上原先的 SpamCop 的检查,希望自己的邮箱和 gmail 的一样干净! 另外, spamassassin [...]

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word