LoginSignup
5
8

More than 5 years have passed since last update.

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

Last updated at Posted at 2016-03-07

参考

設定

/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=user1@myserver.hoge.jp 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
#testaa@examples.com     OK
#spam@spam.com           REJECT
設定反映
postmap /etc/postfix/access
service postfix restart
5
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
8