« ローカル環境で Ethna_MailSender を使う その3 | メイン | 壊れやすいマック ご用達! »

Tips

ローカル環境で Ethna_MailSender を使う その4

自宅のLAN内開発機から外部宛てにメール送信する為のPostfix最小設定。
調べるとあまりに基本的過ぎるためか ddns+自宅メールサーバーを運用する複雑な例が多い。
ここではレンタルサーバーの為もっと単純な構成。受信する要件もなし。
レンタルサーバーは AbleNET


Postfix(Vine4.2Linux) → YahooBB(ADSL8M) → AbleNET → internet


ablenet のSMTPサーバーは
domain.temporarydomain.net
ablenet のアカウントは
test
ablenet のパスワードは
123456789
ablenet メールアドレスは
mymail@domain.com
だとする。

Postfixのデフォルト設定でローカルユーザー間のメール送受信確認済み。
ソフトウェアはその1と同じ
この前提で準備開始

●「SMTP Auth」使うため下記をインストール。
[root@localhost root]# apt-get install cyrus-sasl-devel
[root@localhost root]# apt-get install cyrus-sasl-md5
[root@localhost root]# apt-get install cyrus-sasl-plain
[root@localhost root]# apt-get install db4-devel
詳細バージョンは「その1」と同じ

●1行の認証情報テキストファイルを作成。
[root@localhost root]# vi /etc/postfix/ISPpassword
[domain.temporarydomain.net] test:123456789

注意:ablenetでは[]がないと認証に失敗する
× domain.temporarydomain.net test:123456789

●認証情報テキストファイルからデータベースファイルを作成。
[root@localhost root]# postmap /etc/postfix/ISPpassword
[root@localhost root]# ls -l /etc/postfix/ISPpassword.db (更新されていることを確認)

●必要最小限の /etc/postfix/main.cf 設定内容は
[root@localhost root]# diff /etc/postfix/main.cf.org /etc/postfix/main.cf

myhostname = domain.com

mydomain = domain.com

relayhost = [domain.temporarydomain.net]:587

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/ISPpassword
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = login

●/etc/postfix/main.cf 設定内容のチェック→何も表示されなければOK
[root@localhost root]# postfix check

●新たな/etc/postfix/main.cf で postfixを再起動しログを監視
[root@localhost root]# /etc/rc.d/init.d/postfix restart
[root@localhost root]# tail -f /var/log/maillog

●YahooBB と異なり Fromヘッダーを指定することなく任意のユーザーで
mail myfriend@gmail.com
で送信成功。Ethna_MailSender は特に指定なし。

トラックバック

このエントリーのトラックバックURL:
https://www.remix.asia/cgi/mt/mt-tb.cgi/6681

コメントを投稿

(いままで、ここでコメントしたことがないときは、コメントを表示する前にこのブログのオーナーの承認が必要になることがあります。承認されるまではコメントは表示されません。そのときはしばらく待ってください。)