postfixの設定

Post date: 2016/06/13 3:21:07

CentOS7のALBサーバから直接メールをおくることはできないようなので、so-net経由で送るよう/etc/postfix/main.cfに、以下を設定した。

relayhost = [mail.so-net.ne.jp]:587

smtp_sasl_auth_enable = yes

smtp_sasl_password_maps = hash:/etc/postfix/isppasswd

smtp_sasl_security_options =

smtp_sasl_mechanism_filter = LOGIN, PLAIN, CRAM-MD5

isppasswdには、[mail.so-net.ne.jp]:587 xxxxx@yyy.so-net.ne.jp:zzzzzzzzのようにso-netのメールIDとパスワードを設定した。

postmap /etc/postfix/isppasswd をまず実行する。次に、 systemctl restart postfix

最後にテスト: date|mail -s test seijiro.moriyama@anagix.com