Category Archives: Mail

Mail

另一套 antispam 的軟體 – SpamBayes

最近在測 寫的 ,用了一下發現還蠻簡單的,而且速度不錯。(有可能是因為 ,而 4 的原因)

(mail/py-spambayes) 裝好後 sb_filter.py 就是最簡單的介面,加上 -h 可以看到說明,不加參數跟 -f 一樣,代表 filter,會在 header 加上 X-Spambayes-Classification,可以丟給 或是其他程式判斷。

其他的選項應該只會用到 -g (train as ham) 與 -s (train as spam),可以放到 .muttrc 裡面方便自己 train,有興趣的人可以玩看看:

macro index X "<pipe-entry>sb_filter.py -s > /dev/null\n<delete-message>" "mark as spam"
macro pager X "<pipe-entry>sb_filter.py -s > /dev/null\n<delete-message>" "mark as spam"
macro index Z "<pipe-entry>sb_filter.py -g > /dev/null\n" "mark as innocent"
macro pager Z "<pipe-entry>sb_filter.py -g > /dev/null\n" "mark as innocent"

用完即丟的 mail address

看到 在講用完即丟的 mail address,我之前有用過一些 Disposable Email Address Services,像是 Jetable.org (剛剛發現居然有繁體中文介面) 可以自己設定這個 temporal mail address 要保留多久:24hrs/48hrs/4days/6days/8days。

對於這些用完即丟的 mail address services 也應該要小心挑,因為有些跟本是順便蒐集你的 mail address 來賣… :P 這家在 Disposable Email Address Services 的知名度還算不錯,而且也有歷史了,基本上「可能」比較可以信賴 :p

Microsoft 將 Spammer 告到破產

這對於 spammer 來說是一個重大的打擊,在 Spam King goes bankrupt 提到:

I doubt we’ve seen the last of Scott Richter. But you’ve got to marvel at Microsoft’s handling of this case. Not only did the company apparently get a big judgment where Eliot Spitzer couldn’t, it also orchestrated the release of news about the bankruptcy so it would hit Richter right in his hometown newspapers.

出手的確不一樣。不過很無奈,一般的小老百姓沒辦法像 一樣有這麼多資源。

用 Regular Expression 表示 valid email address

用 Regular Expression 表示合法 e-mail 位置似乎是每隔一陣子就會被拿出來大家笑的東西?

提到的

(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?: \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[
\t])*(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:( ?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\0 31]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+ (?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z |(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n) ?[ \t])*)*\<(?:(?:\r\n)?[
\t])*(?:@(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\ r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n) ?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t] )*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])* )(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*))*) *:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+
|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r \n)?[ \t])*)(?:\.(?:(?:\r\n)?[
\t])*(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?: \r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[ \t
]))*”(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031 ]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](
?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(? :(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?
:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(? :(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)? [
\t]))*”(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[
\t])*(?:(?:(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]| \.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|” (?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t] )*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[“()<>@,;:\
“.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[
\t])*(? :[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[
\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*))*|(?:[^()<>@,;:”.\[\] \000- \031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|( ?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([
^\[\]\r\]|\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[
\t])*(?:[^()<>@,;:” .\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\
]\r\]|\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
\t])*(?:[^()<>@,;:”.\ [\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\
r\]|\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[
\t])*(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]
|\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[
\t])*)?(?:[^()<>@,;:”.\[\] \0 00-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\ .|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|”(? :[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])* (?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[“()<>@,;:”.
\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[
\t])*(?:[ ^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\]
]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[
\t])*)(?:,\s*( ?:(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:\ “.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*)(?:\.(?:( ?:\r\n)?[
\t])*(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
\[“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t ])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t
])+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*)(? :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|
\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*))*|(?: [^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”.\[\ ]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n) ?[
\t])*(?:@(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[”
()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n) ?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[“()<>
@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[“()<>@,
;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n)?[ \t] )*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[“()<>@,;:\
“.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[
\t])*)? (?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\[“()<>@,;:”. \[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t])*)(?:\.(?:(?: \r\n)?[
\t])*(?:[^()<>@,;:”.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
“()<>@,;:”.\[\]]))|”(?:[^”\r\]|\.|(?:(?:\r\n)?[
\t]))*”(?:(?:\r\n)?[ \t]) *))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])
+|\Z|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*)(?:\ .(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:”.\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\[“()<>@,;:”.\[\]]))|\[([^\[\]\r\]|\.)*\](?:(?:\r\n)?[
\t])*))*\>(?:( ?:\r\n)?[ \t])*))*)?;\s*)

Postfix Policy Daemon

freshmeat 看到 PostfixPolicy Daemon。與我目前我在用的 Postgrey 有更多的改進:

  • 這隻 Policy Daemon 用 C 寫,而 PostgreyPerl
  • 除了 Greylisting 以外,還提供了 Sender Throttling,可以對三種 case 做 quota 限制:by (envelope) From address、by SASL username、by IP address or C/class。
  • Spamtrap,設定某些陷阱 mail address,如果有 user 寄到這些位置,那麼就將他的 host/netblock 封住一段時間。

先來叫色兔子玩看看好了 XD