今まで relayhostに指定していた ISPが SMTP auth必須にしたので。
cyrus-SASLが必要らしいけど、既に入っているのでインストールはスキップ。
既に 2.8.1が導入されているので make upgradeを使用。
wget 'http://.../postfix-2.8.1.tar.gz'
tar zxf postfix-2.8.1.tar.gz
cd postfix-2.8.1
make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" AUXLIBS="-lsasl2"
make
make upgrade
/etc/postfix/main.cfを編集。
relayhost = [example.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/client_password
smtp_sasl_mechanism_filter = login, plain, cram-md5
smtp_sasl_security_options =
/etc/postfix/sasl/client_passwordを作成。
example.com username:password
データベースを更新。
postmap /etc/postfix/sasl/client_password
導入自体はうまくいったのだけど、Domain of sender addressとか言われてしまう。*1
-fオプションを指定することで sendmailから送ることには成功したけど、cronの出力はどうすればいいのだろう?
*1 何百通とか不特定多数宛とか送るわけではないのだから、認証を通した相手にグチグチ言うなよ>inst.or.jp