2012-06-14 41 views
-3

我正在使用imap_xxx來訪問我的網站的電子郵件,我們需要放棄系統非人爲生成的所有電子郵件,如不在辦公室,自動回覆,郵件反彈,錯誤等。在PHP中編寫相同的代碼。識別非人爲生成的電子郵件

代碼指針將不勝感激。

感謝

+0

這是否包含自動生成的垃圾郵件? –

+0

聽起來像你應該使用現有的工具,而不是滾動自己的,超級用戶或serverfault可能是一個更好的地方問。 – jjrv

+0

我們可以獨立處理的垃圾郵件部分,目前的需求是識別所有非人爲生成的郵件。 – user19866

回答

3

,你可以應用到信封發件人(「返回路徑」標頭),以檢查自動發送方A幾個正則表達式:

"^owner-", 
"^request-", 
"[email protected]", 
"bounce.*@", 
"[email protected]", 
"[email protected]", 
"^no[\-]?reply", 
"^donotreply", 
"^[email protected]", 
"^mailer[-_][email protected]", 
"^[email protected]", 
"^[email protected]", 
"^majordom[o][email protected]", 
"^[email protected]", 
"^[email protected]", 
"^bounce", 
"^www(-data)[email protected]", 
"^[email protected]", 
"^[email protected]", 
"^[email protected]", 
"^news(letter)[email protected]", 
"^[email protected]", #role accounts, maybe you want these 
"^[email protected]", 

頭指示自動發送,如果它們存在:

"list-help", 
"list-unsubscribe", 
"list-subscribe", 
"list-owner", 
"list-post", 
"list-archive", 
"list-id", 
"mailing-List", 
"x-facebook-notify", 
"x-mailing-list", 
'x-cron-env', 
'x-autoresponse', 
'x-eBay-mailtracker' 

標頭,其指示一個自動發送器,如果它們符合特定的正則表達式:

'x-spam-flag':'yes', 
'x-spam-status':'yes', 
'precedence':'(bulk|list|junk)', 
'x-precedence':'(bulk|list|junk)', 
'x-barracuda-spam-status':'yes', 
'x-dspam-result':'(spam|bl[ao]cklisted)', 
'X-Mailer':'^Mail$', 
'auto-submitted':'auto-replied', 
'X-Auto-Response-Suppress':'(AutoReply|OOF)',