2008年11月18日火曜日

postfixの設定メモ

ddns環境でのpostfixの設定
op25bの為に送信メールがisp(biglobe)のサーバを中継するように設定する
1. biglobeに中継サーバの利用申請をするhttp://support.biglobe.ne.jp/faq/settei/op25b/relay.html
2. main.cfの設定
2.1. relayhost に1.でもらったサーバのFQDNを設定する
2.2. 送信時にSMTP AUTHを使うように設定する
2.3. 送信時にemvelope fromを書き換える
3. libsasl2-modulesをinstall

# diff main.cf.old main.cf
40a41,56
> relayhost = [example.com]:25
>
> smtp_sasl_type = cyrus
> smtp_sasl_auth_enable = yes
> smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
> smtp_sasl_security_options = noanonymous
> smtp_sasl_mechanism_filter = cram-md5, login, plain
>
> sender_canonical_classes = envelope_sender
> sender_canonical_maps = regexp:/etc/postfix/sender_rx
# cat /etc/postfix/sasl_passwd
[example.com]:25 mailaddress:password
# cat /etc/postfix/sender_rx
/^.*/ mailaddress
# postmap /etc/postfix/sasl_passwd
# aptitude install libsasl2-modules
# /etc/init.d/postfix restart
example.com: biglobeの中継サーバ
mailaddress: biglobeのメインメールアドレス
password: メール用のログインパスワード