内容へ移動
メモとかメモのようなものとか(By ルーキーの中のひと)
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
ODT 出力
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
トレース:
serverapps:postfix:smtpauth
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== SMTP Auth ====== SMTP Authにはcyrus-sasl2-saslauthdを使用しています。 ===== インストール ===== <code> # portsinstall security/cyrus-sasl2-saslauthd [X] OPENLDAP ON </code> ==== Ldap対応の確認 ==== <code> # saslauthd -v saslauthd 2.1.23 authentication mechanisms: sasldb getpwent kerberos5 pam rimap ldap ↑Ldap対応確認 </code> ==== 起動 ==== /etc/rc.confに以下を追加。 <code> saslauthd_enable="YES" saslauthd_flags="-a ldap" </code> <code> # /usr/local/etc/rc.d/saslauthd start </code> ===== LDAP認証設定 ===== ==== saslauthd.conf作成 ==== saslauthd.confは作成されていないので自分で作ります。 <code> # touch /usr/local/etc/saslauthd.conf </code> 中身はこんな感じです。 <code> ldap_servers: ldap://ldapサーバアドレス/ ldap_version: 3 ldap_bind_dn: cn=管理者,dc=yyyy,dc=zzz ldap_password: パスワード ldap_search_base: ou=xxxx,dc=yyyy,dc=zzz ldap_filter: uid=%u ldap_deref: search </code> mailアドレスをキーにしたい場合は <code> ldap_filter: mail=%u または ldap_filter: mail=%u@%d # %U=info@example.com # %d=example.com # %u=info </code> に変更 ==== 起動 ==== <code> # /usr/local/etc/rc.d/saslauthd start </code> ==== 以下のコマンドでチェック ==== <code> # testsaslauthd -u XXX -p ***** 0: OK "Succes."と出力されれば、Cyrus-SASLとOpenLDAPの連係はOK 0: NO "authentication failed" だと失敗 </code> ただし、IDに@が含まれていると動作が怪しい。 うちではtestsaslauthd がエラーなのに、SMTP AUTHは動作するというケースが出ています。 かなり、特殊な設定のため以下の様に設定しています。 <code> ldap_filter: (|(mail=%U)(mail=%u@%d)) </code> このときtestsaslauthd はこんな感じです。 <code> # testsaslauthd -u myname -p password 0: OK "Success." # testsaslauthd -u virtialuser@example.com -p password 0: NO "authentication failed" </code> ですが、メールの送信は <code> postfix/smtp[xxx]: xxx: to=<hoge@example.net>, relay=xxx.xxx[nnn...]:25, delay=........., status=sent (250 2.0.0 Ok: queued as xxxxx) </code> のように成功します。う~ん、なぜだろう。:-| FIXME ===== Postfix設定 ===== /etc/postfix/main.cfを以下の様に変更する。 <code> smtpd_sasl_auth_enable=yes smtpd_recipient_restrictions=・・・・・・permit_sasl_authenticated・・・・・・ ↑追加 </code>
serverapps/postfix/smtpauth.txt
· 最終更新: 2017/04/14 14:21 (外部編集)
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
ODT 出力
文書の先頭へ