WordPress でSMTPを使う

WordPressのプラグインWP Mail SMTPを使うとき、テストメールがエラーになったので調べてみました。

Dec  3 23:30:12 h10-1-mail postfix/smtpd[20749]: connect from unknown[10.1.1.6] 
Dec  3 23:30:13 h10-1-mail postfix/smtpd[20749]: warning: connect to Milter service inet:localhost:8891: Connection refused 
Dec  3 23:30:13 h10-1-mail postfix/smtpd[20749]: NOQUEUE: reject: RCPT from unknown[110.1.1.6]: 504 5.5.2 <110.1.1.6>: Helo command rejected: need fully-qualified hostname;

ローカルアクセスなのでFQDNでアクセスできません。検索してみたら次の方法で認証が通りました。

permit_mynetworks,

/etc/postfix/main.cf

# Anti-SPAM rules adapted from https://wiki.debian.org/Postfix 
smtpd_recipient_restrictions = permit_sasl_authenticated, 
        permit_mynetworks, 
        reject_invalid_hostname, 
        reject_unknown_recipient_domain, 
        reject_unauth_destination, 
        reject_rbl_client sbl.spamhaus.org, 
        permit 
 
smtpd_helo_restrictions = reject_invalid_helo_hostname, 
        permit_mynetworks, 
        reject_non_fqdn_helo_hostname, 
        reject_unknown_helo_hostname 
 
#        check_client_access cidr:/etc/postfix/local.cidr, 
 
smtpd_client_restrictions = reject_rbl_client dnsbl.sorbs.net

 

 

Reference:

http://postfix.1071664.n5.nabble.com/Using-quot-reject-unknown-sender-domain-quot-with-exemptions-for-certain-sender-domains-td69054.html