カスタム検索
tomo.gif (1144 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)line.gif (927 ツバツイツト)To previous pageTo home pageMailing to me

メールヘッダーをチェックして受信拒否してみる
(CentOS5)

Created: 11 February 2008


メールヘッダーのチェックを有効にする

ドメインを指定して受信拒否する
ドメインを指定して 廃棄する


メールヘッダーのチェックを有効にする 

"/etc/postfix/main.cf" の以下のコメントはずして有効にします。

header_checks = regexp:/etc/postfix/header_checks

ドメインを指定して受信拒否する 

"/etc/postfix/header_checks"に、以下を記述します。

/^From:.*gmail.com.*/ REJECT

ログは以下のように、拒否が記録されています。

Feb 11 14:31:22 baimail5 postfix/smtpd[2839]: connect from an-out-0708.google.com[209.85.132.244]

Feb 11 14:31:23 baimail5 postfix/smtpd[2839]: 3BE10282C8: client=an-out-0708.google.com[209.85.132.244]

Feb 11 14:31:23 baimail5 postfix/cleanup[2843]:
3BE10282C8: message-id=<fa71bd700802102131o11f1fa64ja9b1863c66f889e6@mail.gmail.com>

Feb 11 14:31:23 baimail5 postfix/cleanup[2843]:
3BE10282C8: reject: header From: tomo@gmail.com from an-out-0708.google.com[209.85.132.244]; from=<tomo@gmail.com> to=<tomo@goodstream.com> proto=ESMTP helo=<an-out-0708.google.com>:
5.7.1 message content rejected

Feb 11 14:31:24 baimail5 postfix/smtpd[2839]: disconnect from an-out-0708.google.com[209.85.132.244]

送信元には、以下の内容が返信されます。

This is an automatically generated Delivery Status Notification

Delivery to the following recipient failed permanently:

    tomo@goodstream.com

Technical details of permanent failure:
PERM_FAILURE: SMTP Error (state 16): 550 5.7.1 message content rejected
 

ドメインを指定して 廃棄する 

"/etc/postfix/header_checks"に、以下を記述します。

/^From:.*gmail.com.*/ DISCARD

ログは以下のように、廃棄が記録されています。

Feb 11 14:58:50 baimail5 postfix/cleanup[3013]:
A3BFE282C8: message-id=<fa71bd700802102158h6621d6d4se34d24b8cd76a9b0@mail.gmail.com>

Feb 11 14:58:50 baimail5 postfix/cleanup[3013]:
A3BFE282C8: discard: header From: tomo@gmail.com from an-out-0708.google.com[209.85.132.246]; from=<tomo@gmail.com> to=<tomo@goodstream.com> proto=ESMTP helo=<an-out-0708.google.com>

Feb 11 14:58:50 baimail5 postfix/smtpd[3011]:
18F85282C8: client=an-out-0708.google.com[209.85.132.244]

Feb 11 14:58:50 baimail5 postfix/cleanup[3013]:
18F85282C8: message-id=<fa71bd700802102006g11aa0dd0qff9cd2d4e4c8a994@mail.gmail.com>

Feb 11 14:58:50 baimail5 postfix/cleanup[3013]:
18F85282C8: discard: header From: tomo@gmail.com an-out-0708.google.com[209.85.132.244]; from=<tomo@gmail.com> to=<tomo@goodstream.com> proto=ESMTP helo=<an-out-0708.google.com>

送信元には、返信されません。


To previous pageTo home pageMailing to meJump to Top of pageline.gif (927 ツバツイツト)line.gif (927 ツバツイツト)tomo.gif (1144 ツバツイツト)
カスタム検索


Tweet