Postfix的smtpd不会跟saslauthd交谈

我有一个saslauthd设置来对PAM进行身份validation。 它似乎做它的东西:

root@sasltest:~# testsaslauthd -u quest -p #### -s smtp 0: OK "Success." 

我有libsasl 2.1.23,postfix 2.7.1。

我有一个后缀configuration如此:

 smtpd_sasl_type = cyrus smtpd_sasl_path = /var/spool/postfix/private/saslauthd/mux smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_sasl_security_options = noanonymous 

通过这样一个master.cf:

 submission inet n - - - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject 

但是,试图在这个后缀进行身份validation提供了以下错误信息:

 Jan 23 22:13:14 sasltest postfix/smtpd[1252]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory Jan 23 22:13:14 sasltest postfix/smtpd[1252]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory Jan 23 22:13:14 sasltest postfix/smtpd[1252]: warning: X[ABCD]: SASL LOGIN 

authentication失败:authentication失败

同时,我的debugging日志saslauthd没有输出。

我认为这意味着libsasl2试图使用sasldb身份validation而不是尝试与saslauthd交谈。 我不知道如何告诉libsasl我想让它和saslauthd交谈。

各种指令会通知您创build文件/etc/sasl2/smtpd.conf或/etc/postfix/sasl/smtpd.conf。 我曾尝试创build这些文件,其中包含:

 pwcheck_method: saslauthd mech_list: LOGIN PLAIN 

但是没有效果。

我如何指示libsasl使用saslauthd身份validation?

(我当然可以创build/ var / spool / postfix / etc / sasldb2,但这仍然不会导致与saslauthd的连接。)

这个cyrus-sasl邮件列表文章最终使我走上了正确的道路。

为了后代,试图产生合理的显式configuration。 /etc/postfix/main.cf文件:

 smtpd_sasl_type = cyrus smtpd_sasl_path = smtpd cyrus_sasl_config_path = /etc/postfix/sasl smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_sasl_security_options = noanonymous 

上面的conf中的技巧是postfix + libsasl2执行此操作:$ {cyrus_sasl_config_path} / $ {smtpd_sasl_path} .conf

一旦我们得到了这么多,在/etc/postfix/sasl/smtpd.conf中,我们可以告诉libsasl我们想和saslauthd交谈:

 pwcheck_method: saslauthd mech_list: LOGIN PLAIN saslauthd_path: private/saslauthd/mux 

由于smtpd是chroot,saslauthd_path是相对于/ var / spool / postfix。 我使用绑定挂载/ var / run / saslauthd进入私有。