灰名單常用來阻擋打了就跑的spam
推測垃圾信發送人為了自己的效率,不會再retry的機制,發展出來的應變機制

1. 安裝postfix (略)

2. 安裝&設定 postgrey
cd /usr/ports/mail/postgrey
make install

vi /etc/rc.conf
postgrey_enable="YES"

vi main.cf
smtpd_recipient_restrictions =
   permit_sasl_authenticated,
   permit_mynetworks,
   check_policy_service inet:127.0.0.1:10023

/usr/local/etc/rc.d/postgrey restart

/usr/local/etc/rc.d/postfix restart

3. 觀察maillog , 的確有達到預期的效果,如果符合條件會先送450 , 請對方晚點再送一次

Mar 13 14:07:52 mail postfix/smtpd[51893]: connect from mail.xx.uz[94.141.xx.138]
Mar 13 14:07:54 mail postfix/smtpd[51893]: Anonymous TLS connection established from mail.xx.uz[94.141.xx.138]: TLSv1 with cipher AES128-SHA (128/128 bits)
Mar 13 14:07:56 mail postgrey[96122]: action=greylist, reason=new, client_name=mail.xx.uz, client_address=94.141.xx.138, sender=xx@oo.xx, recipient=xx@xx.com
Mar 13 14:07:56 mail postfix/smtpd[51893]: NOQUEUE: reject: RCPT from mail.xx.uz[94.141.xx.138]: 450 4.2.0 <xx@xx.com>: Recipient address rejected: Greylisted, see http://postgrey.schweikert.ch/help/mail.xx.com.html; from=<xx@oo.xx> to=<xx@xx.com> proto=ESMTP helo=<mail.xx.uz>
Mar 13 14:07:57 mail postfix/smtpd[51893]: disconnect from mail.xx.uz[94.141.xx.138]

4. 相信每一種antispam的技術一定都不敢保證100%的攔截率或是 0%的誤攔率
灰名單的優點是可以阻擋想打了就跑的spam、在對方下次retry前可以爭取時間,這段時間如果對方ip被列入rbl,即可透過rbl阻擋
缺點是公司mis可能會被抱怨,為什麼對方已經寄出來我很久才收到??或是為什麼我有重要的信沒收到(可能是透過程式發送的郵件,沒有設計retry機制)
另外如果是因為對方帳號被盜用,而且是正常的mail server, 且還沒被列入rbl ,這個機制就破功了orz

arrow
arrow
    文章標籤
    mail antispam postfix
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()