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