最近Gmail宛てにメールが送信できないということに気づきました。
調べてみるとhttps://support.google.com/mail/answer/10336に書かれているように、信頼されていないIPアドレスからメールを送信した場合エラーになるようです。
この問題を解決するためにプロバイダによって提供されているSMTPサーバーを経由してメールを送信する設定を行います。
Postfixの設定ファイルmain.cfを編集してrelayhostを追加します。300行目あたりです。
vi /etc/postfix/main.cf
# INTERNET OR INTRANET # The relayhost parameter specifies the default host to send mail to # when no entry is matched in the optional transport(5) table. When # no relayhost is given, mail is routed directly to the destination. # # On an intranet, specify the organizational domain name. If your # internal DNS uses no MX records, specify the name of the intranet # gateway host instead. # # In the case of SMTP, specify a domain, host, host:port, [host]:port, # [address] or [address]:port; the form [host] turns off MX lookups. # # If you're connected via UUCP, see also the default_transport parameter. # #relayhost = $mydomain #relayhost = [gateway.my.domain] #relayhost = [mailserver.isp.tld] #relayhost = uucphost #relayhost = [an.ip.add.ress] #プロバイダのSMTPサーバーを追加する relayhost = [mail.XXXXXXXXXXXXX.or.jp]
コメント