Google 風格的「您的網路產生過多流量」的 postfix 彈跳

Google 風格的「您的網路產生過多流量」的 postfix 彈跳

我受到了殭屍網路的攻擊,我發現了這一點,因為我收到了來自郵件守護程式的電子郵件,告訴我設備上沒有剩餘空間。 mail.log 充滿了類似的訊息

Dec 5 01:56:14 ip-xxx-xxx-xxx postfix/smtpd[9634]: NOQUEUE: reject: RCPT from xxx-xxx-xxx-xxx.dynamic.hinet.net[xxx.xxx.xxx.xxx]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=SMTP helo=<xxx.xxx.xxx.xxx>

我寫了一個殭屍網路殺手腳本。該腳本使用 iptables 禁止具有太多 IP 位址的網路範圍嘗試透過我的伺服器發送訊息,從而在日誌檔案中產生上述訊息。

我確信這會殺死合法的流量。我決定需要此流量如下:

S0 - standard traffic - <1 mail per minute
S1 - increased traffic - 1+ mail per minute
S2 - suspicious traffic - 10+ mails per minute
S3 - potentially unwanted traffic - 1+ mails per second
S4 - attack - 5+ mails per second

....處理如下:

S0: No action
S1: Log
S2: Log&MailReport (to postmaster@localhost)
S3: Log&MailReport&AutoBounce (solve capcha at http://myhost.tld/anti-spam )
S4: Log&MailReport&AutoBounce (you were temporarily blocked by the mailserver)
S5: Log&MailReport&AutoBounce&AutoAbuseReport (User [email protected] is abusing our server)

有什麼辦法可以使用 postfix 來完成這個任務嗎?如果沒有 - 有沒有更好的郵件伺服器?

謝謝


編輯:我完全重寫了這個問題,因為人們感到困惑並認為這是一個開放中繼

答案1

實際上,這只是運行面向 Internet 的郵件伺服器的本質。我在本地運行一封郵件作為我們的公司郵件,每隔幾秒鐘我們就會收到垃圾郵件。您真正能做的唯一一件事就是實施logrotate並防止日誌成長失控。如果您因歷史原因需要它們,gzip可以將它們壓縮高達 90% 或更多。

如果您想看一下這個,請查看包含大量操作資訊的文章。

相關內容