作者 主題: [問題] Postfix 如何防止大量郵件寄入  (閱讀 4305 次)

0 會員 與 1 訪客 正在閱讀本文。

millhost

  • 懷疑的國中生
  • **
  • 文章數: 74
    • 檢視個人資料
各位大大

請問Postfix 如何防止大量郵件寄入,我見列 Yahoo 及 Gmail 防止同一個 IP 短時間內寄入大量郵件。
我已以有Dspam (類似 spam assassin) 做郵件過濾,但它好像沒有防止同一個 IP 短時間內寄入大量郵件的工能。

請各位大大賜教。

Thanks

kenduest

  • 酷!學園 學長們
  • 俺是博士!
  • *****
  • 文章數: 3675
    • 檢視個人資料
    • http://kenduest.sayya.org
回覆: [問題] Postfix 如何防止大量郵件寄入
« 回覆 #1 於: 2010-02-22 11:21 »

請參考 postfix manual:

http://www.postfix.org/anvil.8.html
I am kenduest - 小州

my website: http://kenduest.sayya.org/

被騎上班的老

  • 酷!學園 學長們
  • 活潑的大學生
  • ***
  • 文章數: 360
    • 檢視個人資料
回覆: [問題] Postfix 如何防止大量郵件寄入
« 回覆 #2 於: 2010-02-22 14:09 »
這個不錯!

不過大家可以參考下面這個,我也正在試。基本上這樣可以在防火牆擋下來,根本不讓封包碰到 postfix。範例是 22 port,可以改成任何 port。

原稿:http://lists.centos.org/pipermail/centos/2008-January/051102.html

引用
To deal with brute force attacks (not just on ssh) I spent some time tracking
down how others had dealt with the problem. I discovered thereby that one can
use the simple linux firewall iptables to restrict the number of connections
to a given port from a single source over a specified interval. I therefore
added these rules to my /etc/sysconfig/iptables file:
代碼: [選擇]
...
# This is usually present in all setups but, you never know....
# Established connections go right through.
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
...

# Block brute force attacks
# Drop repeated ssh connection attempts within 20 seconds interval
-A RH-Firewall-1-INPUT -p tcp -m tcp -m state -m recent -i eth0 --dport 22
--state NEW -j DROP  --rcheck --seconds 20 --name THROTTLE --rsource

# Accept ssh connection if not attempted within past 20 sec.
-A RH-Firewall-1-INPUT -p tcp -m tcp -m state -m recent -i eth0 --dport 22
--state NEW -j ACCEPT  --set --name THROTTLE --rsource
You can change the interval from 20 seconds to whatever you feel represents a
decent compromise between user satisfaction and security.  Many authorities
considered a value between 3 and 6 seconds sufficient to render brute force
attacks impractical.  These rules can be trivially modified to protect any
destination port (-dport 21 for ftp for instance) or protocol (-p udp).

firewall 我不太懂,請懂的人幫我檢查一下。

被騎上班的老

  • 酷!學園 學長們
  • 活潑的大學生
  • ***
  • 文章數: 360
    • 檢視個人資料
回覆: [問題] Postfix 如何防止大量郵件寄入
« 回覆 #3 於: 2010-02-24 16:37 »
http://www.upfrontsystems.co.za/Members/izak/sysadman/an-iptables-fix-for-dictionary-spam-tactics

這個看起來最適合

代碼: [選擇]
iptables -N block_spammers
iptables -A block_spammers -p tcp --dport smtp -m recent --set --name MAIL
iptables -A block_spammers -p tcp --dport smtp -m recent --update --seconds 30 --hitcount 4 --name MAIL -j DROP
iptables -I INPUT 1 -i eth0 -m state --state NEW -j block_spammers