Postfix2.3で、header_checks を使って MAILER-DAEMON からのバウンスメールをDISCARDしたいのですが、うまく行きません。下記の設定でいける用に思えるのですが、何か間違っているのでしょうか。
header_checks は MAILER-DAEMON からのメールには効果が無かったりするのでしょうか。
バウンスメールのヘッダ確認
# postcat -q 28407101307 ... *** MESSAGE CONTENTS active/28407101307 *** Received: by centos5.localdomain (Postfix) id 28407101307; Wed, 23 Dec 2015 06:58:50 +0900 (JST) Date: Wed, 23 Dec 2015 06:58:50 +0900 (JST) From: MAILER-DAEMON@centos5.localdomain (Mail Delivery System) Subject: Undelivered Mail Returned to Sender To: to@example.com ...
main.cfに以下を追加
header_checks = pcre:/etc/postfix/header_checks
/etc/postfix/header_checks の中身
/^To: to@example.com.*/ DISCARD
シンタックスチェック
# postmap -fq "To: to@example.com" pcre:/etc/postfix/header_checks DISCARD
mailコマンドでDISCARDしたいアドレスにメールを送ると、想定通りDISCARDされる
# service postfix restart # echo "Test Mail." | mail -s "test mail" to@example.com
以下のように frm/to どちらも存在しないメールを送ると、MAILER-DAEMON が to@example.com 宛にバウンスメールを送るが、これはDISCARDされずにmailqに滞留する
# echo "Test Mail." | mail -s "test mail" from@example2.com -- -f to@example.com
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/01/06 00:39 編集
2016/09/22 15:50