DragonflyBSD+postfix+SMTP Auth(gmail)
コマンドの準備は前回まで出できている(はず)として、いよいよ設定に入ります。(1) まずは、postfix の設定(つまり、pkgsrc を使用して postfix をインストールしたとすると /usr/pkg/etc/postfix の下にある main.cf を書き換えます。* 基本的な設定は前回までに済んでいる(はず:手抜きですみません;;)ですので、追加する部分だけを# relayhost として Gmail の SMTP ホストを使用します。 submission ポート 587 も忘れずにrelayhost = [smtp.gmail.com]:587# TLS の使用を定義します。smtp_use_tls = yes# SASL 認証の使用を定義します。smtp_sasl_auth_enable = yes# SASL 認証のためのパスワードファイルを指定します。# sasl_passwd ファイルについては後ほどsmtp_sasl_password_maps = hash:/usr/pkg/etc/postfix/sasl_passwd(2)-1/usr/pkg/etc/postfix/sasl_passwd の作成 /usr/pkg/etc/postfix/sasl_passwd という名前で [smtp.gmail.com]:587 メールアドレス:パスワード というファイルを作成します。※ メールアドレスは xxxxx@gmail.com※ パスワードは上記のアドレスのパスワード(2)-2/usr/pkg/etc/postfix/sasl_passwd の作成postmap sasl_passwdを実行すると[user@dragonflybsd] $ ls -l /usr/pkg/etc/postfix/total 204drwxr-xr-x 1 root wheel - 0 Feb 28 17:34 ./drwxr-xr-x 1 root wheel - 0 Feb 6 20:54 ../-rw-r--r-- 1 root wheel - 27039 Feb 28 17:36 main.cf-rw-r--r-- 1 root wheel - 5093 Feb 6 21:17 master.cf-rwxr-xr-x 1 root wheel - 24256 Feb 6 21:17 post-install*-rwxr-xr-x 1 root wheel - 8087 Feb 6 21:17 postfix-script*-rw-r--r-- 1 root wheel - 95 Feb 28 17:35 sasl_passwd-rw-r--r-- 1 root wheel - 65536 Feb 28 17:35 sasl_passwd.dbこんな感じになっているかと思います。っで、結局とのこと、main.cf に追加したのは以下のとおり## ++ for SMTP Auth ++++++++++++++++++++++++++++++++++++++++++++++++++++++++relayhost = [smtp.gmail.com]:587smtp_use_tls = yessmtp_sasl_auth_enable = yessmtp_sasl_password_maps = hash:/usr/pkg/etc/postfix/sasl_passwdsmtp_sasl_security_options = noanonymoussmtp_sasl_mechanism_filter = plain,loginsmtp_tls_CAfile = /etc/pki/CA/Thawte_Premium_Server_CA.pem# ↑↑↑↑↑↑↑↑ これは、(エラーその1)のようなエラーが発生したときの為エラーその12010-02-14T18:09:12.342160+09:00 df24x postfix/pickup[2571]: 533E4E7913D8: uid=1001 from= (xxxxxxx)2010-02-14T18:09:12.376409+09:00 df24x postfix/cleanup[2582]: 533E4E7913D8: message-id=<20100214090912.533E4E7913D8@DragonflyBSD24x.domain.jp>2010-02-14T18:09:12.395112+09:00 df24x postfix/qmgr[2572]: 533E4E7913D8: from= (xxxxx@test.co.jp) , size=317, nrcpt=1 (queue active)2010-02-14T18:09:13.560558+09:00 df24x postfix/smtp[2584]: certificate verification failed for smtp.gmail.com[74.125.95.109]:587: untrusted issuer /C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com2010-02-14T18:09:15.663560+09:00 df24x postfix/smtp[2584]: 533E4E7913D8: to= (xxxxx@test.co.jp) , relay=smtp.gmail.com[74.125.95.109]:587, delay=3.4, delays=0.09/0.08/2.2/0.99, dsn=2.0.0, status=sent (250 2.0.0 OK 1266138555 23sm5010491iwn.7)2010-02-14T18:09:15.665904+09:00 df24x postfix/qmgr[2572]: 533E4E7913D8: removed