无法获得SASL auxprop / sasldb与Postfix / Ubuntu 12.04一起工作

我有一个运行Postfix 2.5.1的Ubuntu 8.04LTS系统。 在该系统上SMTP AUTH运行良好/etc/postfix/sasl/smtpd.conf的内容是:

 pwcheck_method: auxprop auxprop_plugin: sasldb mech_list: PLAIN 

SASL相关的属性是:

 smtpd_sasl_type = cyrus smtpd_sasl_auth_enable = yes smtpd_sasl_path = smtpd smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_sasl_local_domain = $myhostname 

当我做sudo sasldblistusers2我得到:

 [email protected]: userPassword 

就像我所说的那样,在8.04LTS系统上都可以正常工作。

但是,我正在尝试将其迁移到运行Postfix 2.9.3的Ubuntu 12.04LTS系统,我无法使其运行。 我做的一切都一样,但每次后缀都会导致身份validation失败。

这不是/etc/sasldb2文件。 我试过从旧系统中引入文件,这是行不通的。 我已经创build了一个新的文件:

 saslpasswd2 -c -u mail.mydomain.com authusername 

这是行不通的,尽pipe如果我把它复制到旧的系统上,它就可以在旧的系统上工作,这就是我知道这个文件没有问题的地方。

同样,我知道postfix正在看到smtpd.conf文件。 如果我向文件的mech_list行添加更多的机制,当我连接到smtpd守护进程时,会看到那些额外的机制。 当我把它们移走时,它们又会离开。 所以/etc/postfix/sasl/smtpd.conf显然已经被使用了。

我正在testing通过使用实际的邮件客户端,并通过以下方式生成令牌后手动与服务器通话:

 perl -MMIME::Base64 -e 'print encode_base64("\000authusername\000thePassword");' 

然后:

 openssl s_client -quiet -starttls smtp -connect the.newsystem.com:587 

由此产生的对话是:

 250 DSN EHLO example.com 250-the.newsystem.com 250-PIPELINING 250-SIZE 20971520 250-ETRN 250-AUTH PLAIN 250-AUTH=PLAIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN AUTH PLAIN theBase64EncodedToken 535 5.7.8 Error: authentication failed: authentication failure 

但是如果我连接到the.oldsystem.com:587并做同样的事情,我会得到:

 235 2.7.0 Authentication successful 

新机器上saslfinger的输出是:

 # sudoh saslfinger -s saslfinger - postfix Cyrus sasl configuration Sat Jul 21 00:24:24 EDT 2012 version: 1.0.4 mode: server-side SMTP AUTH -- basics -- Postfix: 2.9.3 System: Ubuntu 12.04 LTS \n \l -- smtpd is linked to -- libsasl2.so.2 => /usr/lib/i386-linux-gnu/libsasl2.so.2 (0xb76c5000) -- active SMTP AUTH and TLS parameters for smtpd -- broken_sasl_auth_clients = yes smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_sasl_path = smtpd smtpd_sasl_security_options = noanonymous smtpd_sasl_type = cyrus smtpd_tls_CAfile = /etc/ssl/certs/MyCA.pem smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/postfix/ssl/server.crt smtpd_tls_key_file = /etc/postfix/ssl/server.key smtpd_tls_loglevel = 1 smtpd_tls_security_level = may smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_tls_session_cache_timeout = 3600s -- listing of /usr/lib/sasl2 -- total 16 drwxr-xr-x 2 root root 4096 Jul 20 23:00 . drwxr-xr-x 67 root root 8192 Jul 20 21:25 .. -rw-r--r-- 1 root root 1 May 4 00:17 berkeley_db.txt -- listing of /etc/postfix/sasl -- total 20 drwxr-xr-x 2 root root 4096 Jul 20 21:29 . drwxr-xr-x 5 root root 4096 Jul 20 23:58 .. -rw-r--r-- 1 root root 64 Jul 20 21:29 smtpd.conf -- content of /etc/postfix/sasl/smtpd.conf -- pwcheck_method: auxprop auxprop_plugin: sasldb mech_list: PLAIN -- content of /etc/postfix/sasl/smtpd.conf -- pwcheck_method: auxprop auxprop_plugin: sasldb mech_list: PLAIN -- active services in /etc/postfix/master.cf -- # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) smtp inet n - - - - smtpd submission inet n - - - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING [snipping the rest of the services] -- mechanisms on localhost -- -- end of saslfinger output -- 

我可能会错过什么/做错了什么? 据我所知,所有的configuration是相同的,但它不会在新系统上工作。

赠品在这里:

 -- active services in /etc/postfix/master.cf -- # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) smtp inet n - - - - smtpd submission inet n - - - - smtpd 

submission端口上的smtpd进程以chroot模式运行(因为在该列中有-表示缺省( yes )应用,因此不能看到/etc/sasldb2

当我复制/etc/sasldb2/var/spool/postfix/etc身份validation开始工作正常。

chroot是defnitely的原因,但是对于我的情况,复制到/var/spool/postfix/etc不起作用。

所以我刚刚摆脱了chroot,这对我很有用。

为了做到这一点,您需要编辑/etc/postfix/master.cffind以下行:

 smtp inet n - - - - smtpd 

并修改如下:

 smtp inet n - n - - smtpd 

另一种将sasldb2文件同步到postfix的默认chroot jail的方法是添加一个硬链接到它:

 ln /etc/sasldb2 /var/spool/postfix/etc/ 

请注意,符号链接不会工作,因为符号链接不能从监狱里面访问,但硬链接可以。 这比简单复制文件有优势,因为未来的新用户和密码更改将自动同步,甚至没有后缀重新加载。