Postfix > SMTP認証

PostfixでSMTP認証を行う場合の手順。




■検証結果
Cyrus-SASLやPostfixとの連携についてのまとまった情報が存在せず、
SE対応が必要のため微妙。

[ポイント]
以下の4項目で設定する必要がある(模様)。
1.Cyrus-SASLの設定
2.DALP(OpenLDAP)側の設定
3.Postfixの設定(SMTP-AUTH)
4.Postfixの設定(SMTPS)

実質的に、Postfix側でLDAP認証する場合と、
SMTPS(SMTP over SSL)は別物なので注意が必要。


参考情報

この辺のサイトが役に立った。
http://sy2920.s151.xrea.com/mail/smtpauth-ldap1.html


Cyrus-SASLパッケージのインストール

cyrus-sasl-2.1.23
cyrus-sasl-lib-2.1.23
cyrus-sasl-plain-2.1.23



Cyrus-SASLの設定

[LDAPで認証する設定]
/etc/sysconfig/saslauthd:
MECH=ldap 


[SASLでLDAP検索を行ってユーザ認証を行う設定]
/etc/saslauthd.conf:
ldap_servers: ldap://localhost/ 
ldap_search_base: ou=users,dc=test,dc=local 
ldap_filter: uid=%u 
※上記設定ファイルを新規作成する。
※接続先と、検索ベースの情報を指定する。



Cyrus-SASL認証サービスの起動

/etc/init.d/saslauthd start 
chkconfig saslauthd on 

※自動起動するようにしておく。


Cyrus-SASLの動作確認

testsaslauthd -u etr-user1 -p password 
0: OK "Success." 

testsaslauthd -u etr-user1 -p passwordx 
0: NO "authentication failed" 


※saslauthdサービスが起動していない場合、認証エラーになる。
connect() : No such file or directory 


Postfix側の設定(SMTP-AUTH)

以下を設定してサービスを再起動する。

/etc/postfix/main.cf:
smtpd_sasl_auth_enable = yes 
smtpd_sasl_security_options = noanonymous 
broken_sasl_auth_clients = yes 
smtpd_sasl_local_domain = $myhostname 
smtpd_recipient_restrictions = 
    permit_sasl_authenticated, 
    reject 



最終更新日 : [2014-02-20]
最終更新:2014年02月20日 23:44