postfixで複合条件アクション

こんな感じでスパムメールを拒否してみた

目標は:特定のIPかつ(123.123.123.123)、特定のアドレス(reject@)を拒否する

まず、check_client_accessをつくる
smtpd_restriction_classesで制限クラスをつくって
client_accessで定義した制限クラスに飛ばす


/etc/postfix/main.cf
smtpd_recipient_restrictions = permit_mynetworks ,
check_client_access hash:/etc/postfix/client_access ,
permit_sasl_authenticated ,
reject_unauth_destination
smtpd_restriction_classes = spam_restriction
spam_restriction = check_recipient_access hash:/etc/postfix/rejectaddress

/etc/postfix/client_access
123.123.123.123 spam_restriction

/etc/postfix/rejectaddress
reject@ REJECT

参考リンク
Postfix で特定の IP アドレスを拒否する設定
[postfix-jp: 115] Re: 複合条件での送信制限は可能でしょうか?