大网数据广告活动
服务器运维问答

Postfix smtpd won't talk to saslauthd

· 52CE 我爱测

I have an saslauthd setup to authenticate against PAM. It seems to do its stuff: root@sasltest:~# testsaslauthd -u quest -p #### -s smtp 0: OK "Success." I have libsasl 2.1.23, postfix 2.7.1. I have a postfix configured thus: smt…

问题原文

原帖链接 · Bittrance · CC BY-SA 3.0

I have an saslauthd setup to authenticate against PAM. It seems to do its stuff:

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

I have libsasl 2.1.23, postfix 2.7.1.

I have a postfix configured thus:

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

With a master.cf thus:

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

However, trying to authenticate in this postfix gives the following error message:

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[A.B.C.D]: SASL LOGIN

authentication failed: authentication failure

Meanwhile, there is no output from my debug-logging saslauthd.

I interpret this as meaning that libsasl2 tries to uses sasldb auth rather than try to talk to saslauthd. What I can't figure out how to tell libsasl that I want it to talk to saslauthd.

Various instructions inform you to create a file /etc/sasl2/smtpd.conf or /etc/postfix/sasl/smtpd.conf. I have tried creating these files containing:

pwcheck_method: saslauthd
mech_list: LOGIN PLAIN

But to no effect.

How do I instruct libsasl to use saslauthd authentication?

(I can of course create /var/spool/postfix/etc/sasldb2, but this will still not result in connections to saslauthd.)

已采纳解答

原帖链接 · Bittrance · CC BY-SA 3.0

This cyrus-sasl mailing list post eventually set me on the right path.

For posterity, an attempt to produce reasonably explicit config. /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

The trick in above conf is that postfix+libsasl2 does this: ${cyrus_sasl_config_path}/${smtpd_sasl_path}.conf

Once we have gotten that far, in /etc/postfix/sasl/smtpd.conf we can tell libsasl that we wanna talk to saslauthd:

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

Since smtpd is chrooted, saslauthd_path is relative to /var/spool/postfix. I use bind mounting to get /var/run/saslauthd into private.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-01-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。