Gmailのメールサーバーから送信するメールはOP25Bの影響は受けないため、全ての送信メールをGmailを経由して送信するようにする。
[root@centos ~]# vi /etc/postfix/main.cf ← Postfix設定ファイル編集 以下を最終行へ追加 relayhost = [smtp.gmail.com]:587 smtp_use_tls = yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_tls_security_options = noanonymous smtp_sasl_mechanism_filter = plain smtp_tls_CApath = /etc/pki/tls/certs/ca-bundle.crt |
[root@centos ~]# echo [smtp.gmail.com]:587 Gmailアドレス:Gmailパスワード > /etc/postfix/sasl_passwd ← SMTP認証情報設定 |
[root@centos ~]# chmod 640 /etc/postfix/sasl_passwd ← root以外参照できないようにパーミッション変更 |
[root@centos ~]# postmap /etc/postfix/sasl_passwd ← SMTP認証情報のデータベース化 |
[root@centos ~]# systemctl reload postfix ← Postfix設定反映 |