逆引きできないホストからのメール受信拒否


参考

設定

/etc/postfix/main.cf
 smtpd_client_restrictions =
    permit_mynetworks,
+   reject_unknown_client,
    permit

ログ確認

$ tail -f /var/log/mail.* | grep rejected

Mar 7 09:54:12 mx.srv1 postfix/smtpd[29547]: NOQUEUE: reject: RCPT from unknown[123.50.215.159]: 450 4.7.1 Client host rejected: cannot find your hostname, [123.50.215.159]; from= to=[email protected] proto=SMTP helo=<[123.50.215.159]>

受信を例外的に許可したい場合

/etc/postfix/main.cf
 smtpd_client_restrictions =
    permit_mynetworks,
+   check_client_access hash:/etc/postfix/access,
+   reject_unknown_client,
    permit
  • /etc/postfix/access
/etc/postfix/access
## IP Address Rule
22.22.22        OK # 22.22.22.0/24

#200.189.73.2            REJECT

# Domain Rule
myserver.com            OK
mydomain.jp             OK

# Address Rule
#[email protected]     OK
#[email protected]           REJECT
設定反映
postmap /etc/postfix/access
service postfix restart