Sendmail 8.13 有一個新增的功能叫 greet_pause ,它的功能很簡單
當客戶端要連線至本機時, Greeting banner 不會立即出現,要等一個已設定時間才可以開始進行 SMTP conversation,對 spammers 來說,因為要大量寄信,等幾秒也是長時間,故此這方法可以阻擋一部份垃圾郵件,根據我的實際測試,大約少了 5%左右。
應用方法,在 sendmail.mc 檔上加上:
FEATURE(`greet_pause',5000)
Greeting banner 就會 5秒後才會出現。如果你有一些 trusted networks ,可以在 access 檔上加上:
GreetPause:localhost 0
GreetPause:123.124.0.1 0
這樣就可以 "whitelist" 以上 ip address。
我暫時在 Postfix 找不到這樣的一個 feature,因為她們認為 greeting pause 對正常郵件的「懲罰」太大了。
2007年1月11日 星期四
Greeting Pause
2007年1月10日 星期三
Composite RBL (DNSBL) checking
以下網址幫你一次過檢視大部份公開 (Public) 的DNSBL site
這些網址將會不定期更新!!!
http://openrbl.org
http://www.robtex.com/rbls.html (www.robtex.com 也有很多有用的工具可用)
http://www.completewhois.com/rbl_lookup.htm
http://moensted.dk/spam
http://ipremoval.sms.symantec.com/lookup/
http://www.myiptest.com/staticpages/index.php/check-Blacklisted-IP-DNSBL
http://www.dnsstuff.com (我最常用的,除了 RBL checking 外也有 DNS checking 和 Email address checking 等服務。
http://multirbl.valli.org
The Google blacklist for Phishing Sites
sb.google.com/safebrowsing/
裝了 Google toolbar for Firefox 或 Firefox 2 就會自動用到。
2007年1月8日 星期一
Spamhaus PBL
Spamhuas 新推出的 DNSBL
The Policy Block List
The Spamhaus PBL is a DNSBL database of end-user IP address ranges which should not be delivering unauthenticated SMTP email to any Internet mail server except those provided for specifically by an ISP for that customer's use. The PBL helps networks enforce their Acceptable Use Policy for dynamic and non-MTA customer IP ranges.
PBL IP address ranges are added and maintained by each network participating in the PBL project, working in conjunction with the Spamhaus PBL team, to help apply their outbound email policies. Additional IP address ranges may be added and maintained by the Spamhaus PBL Team, particularly for networks which are not participating themselves, and where spam, rDNS and server patterns
are consistent with end-user IP space which typically contain high concentrations of "botnet zombies", a major source of spam.
A list of participating networks will be available soon. Spamhaus encourages all dialup, DSL and cable modem providers to participate and submit their own PBL ranges.
這是 ISP 自動參與的 DNSBL,ISP 指定那些 ip range 不是用她們指定的 SMTP server 寄信,而真接 email direct to MX.
但我的問題是: 為何這些 ISP 不 block 了 outgoing port 25,正如香港的ISP Netvigator那般,根本她們的用戶就不能 direct to mx!!
2007年1月3日 星期三
image spam
FuzzyOCR 是一個 Spamassassin 的 Plugin ,專門對付日益增加的 Image Spam。以下是 installation guide for RHEL/CentoS and Fedora OS: (source: MailScanner wiki)
Pre-requisities
a. You’ll need the netpbm and libungif RPMs from the RedHat / Centos YUM repository
b. You’ll also need the GOCR rpm (build it yourself or use the Dag Wieers repository).
c. Finally you’ll need the String::Approx perl module.
Install the natively available RPMS
YUM does a fantastic job here.
# yum install netpbm netpbm-devel netpbm-progs gtk+-devel libungif libungif-devel libungif-progs
Next we install the gocr RPM.
# mkdir /root/FuzzyOcrPlugin
# cd /root/FuzzyOcrPlugin
# wget http://jaist.dl.sourceforge.net/sourceforge/jocr/gocr-[latest-version].tar.gz
# tar xzf gocr-[latest-version].tar.gz
# cd gocr-[latest-version]
# perl -e "s/^%configure --with-netpbm=no/%configure/g;" -pi gocr.spec
# cd .. # tar czf gocr-[latest-version].custom.tar.gz gocr-[latest-version]
# rm -fr gocr-[latest-version]
# rpmbuild -ta gocr-[latest-version].custom.tar.gz
# cd /usr/src/redhat/RPMS/i386/
# rpm -ivh gocr-[latest-version]-1.i386.rpm gocr-devel-[latest-version]-1.i386.rpm
# cd -
Now we come to the String::Approx installation Don’t trouble yourself, simply use CPAN for this.
# perl -MCPAN -eshell cpan> install String::Approx
Finally we download and install the FuzzyOCR library and cf file.
The latest release is always available as fuzzyocr-latest.tar.gz (though it could change withut notice). The main download page is at http://fuzzyocr.own-hero.net/wiki/Downloads
# wget http://users.own-hero.net/~decoder/fuzzyocr/fuzzyocr-latest.tar.gz
# tar xzf fuzzyocr-latest.tar.gz
# cd Fuzzy*
# mv FuzzyOcr.cf FuzzyOcr.pm /etc/mail/spamassassin
# mv FuzzyOcr.words.sample /etc/mail/spamassassin/FuzzyOcr.words
Test out the setup
And finally the test.
# spamassassin -x -D --lint
Check for lines like:
[4466] dbg: plugin: fixed relative path: /etc/mail/spamassassin/FuzzyOcr.pm
[4466] dbg: plugin: loading FuzzyOcr from /etc/mail/spamassassin/FuzzyOcr.pm
[4466] dbg: plugin: registered FuzzyOcr=HASH(0x9467294)
[4466] dbg: plugin: FuzzyOcr=HASH(0x9467294) implements 'parse_c
試驗:
上圖是其中一封垃圾電郵的 Image Span, 加上 FuzzyOcrPlugin 後,spamassassin 的分數加上
* 5.0 FUZZY_OCR BODY: Mail contains an image with common spam text inside
* Words found:
* "company" in 1 lines
* "trade" in 1 lines
* "target" in 1 lines
* (3 word occurrences found)
都算厲害,我肉眼都未能立時看到這三個字!!!
更多資料:
Google Search
FuzzyOCR 網站
標籤: FuzzyOCR, spamassassin
2007年1月2日 星期二
maRBL
MTA level 的 antispam 方法一般是使用 RBL,但又恐怕會「殺錯」良民,經常跟中國大陸電郵聯絡的都知道很多 ip address 已經入了後多的 RBL,如果在 MTA level 已擋回,正常郵件真的無法進入,使用 spamassassin 只是可以針對 RBL 計分,實際郵件數量是沒有減少的。上文提到的 greylist 也有它的問題。現在就有一種融合兩者好處的方式: maRBL。它對郵件的處理方式是: 只針對 RBL 內的 ip address 做 greylisting,其它不做。
即就算是入了 RBL 的寄件者只要通過 greylisting 仍然可以寄到信給我們。
Greylist 也不需要考慮 smtp cluster 的問題了 (我想興建了 smtp cluster 的 ISP/mail providers 不會對 RBL 不處理吧)
更多資料:
Greylist (my blog)
maRBL
標籤: DNSBL, greylist, spamassassin
Greylist
上圖顯示我的 server 在 11月中開始啟動 greylisting 後郵件數量的變化,垃圾郵件減少了 2/3。Greylist 的原理很簡單:
1. 除了特定的 whitelist ip address 或 email address,所有 incoming 的 smtp connection 都會通知被告知 : Greylisting in action, please come back in 00:30:00 (時間可以控制!!)
2. 同時會記下 1. sending email address, sending smtp ip address 和 receiving email address
3. 大部份合乎 RFC 821 的 sending side MTA 會於稍後時間 retry 寄信,所以最後也會收到的。收信後也會自動做 whitelist (記下上述第 2 點的 tuples),下次同樣的 tuple 就不需要 Retry!
4. 一般 spammers 的 MTA 是不會 Queue 電郵的,一次試不到就會離開。
Greylist 是一項簡單而有效的阻擋垃圾電郵的方法,但也有缺點:
1. 對一些無法建立 whitelist 的企業,這意味電郵以後不會立即收到。這對一些經常有新客戶電郵查詢的行業未必適合。
2. 上面也說「大部份合乎 RFC 821 的 sending side MTA」,但也有例外的,所以在 greylist 設定檔必須加入 execptional list:
http://cvs.puremagic.com/viewcvs/greylisting/schema/whitelist_ip.txt?rev=1.12 或
http://www.assistant-soft.com/orf/GreylistIPexcptionList/GreylistIPexcptionList.txt (這個包括了中國大陸的 MTA)
3. 對行 cluster 的 sending side MTA, sending ip address 不一定每一次是相同的,我試過由 Gmail 寄信給我也要一整天才收到。
更多資料:
Google
Greylisting 首頁
milter-greylist (For Sendmail 的)
SQLGrey (For Postfix 的)