我按照http://www.postfix.org/SASL_README.html#server_dovecot_comm描述中的规定configuration了postfix和dovecot以激活sasl身份validation。
不幸的是,postfix拒绝每个连接,并在日志中显示以下错误
postfix/smtpd[5238]: fatal: no SASL authentication mechanisms
我正在使用Ubuntu LTS 10.04。
我看到很多人都在报告这个模糊的错误,但没有描述明确的诊断。 目前还不清楚问题是在鸽子一侧还是后缀一侧。
更新 :使用postconf |获得的postfix saslconfiguration grep -e“^ smtpd。* sasl”
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_client_access hash:/etc/postfix/access, reject_rbl_client bl.spamcop.net, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client korea.services.net smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = no smtpd_sasl_exceptions_networks = smtpd_sasl_local_domain = smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous, noplaintext smtpd_sasl_tls_security_options = noanonymous smtpd_sasl_type = dovecot
当试图连接智能telnet本地主机25连接立即closures与上述消息。 注释掉smtpd_sasl_auth_enable = yes将禁用sasl,连接正常完成。
鸽舍configuration获得dovecot-n
# 1.2.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-41-generic i686 Ubuntu 10.04.4 LTS log_timestamp: %Y-%m-%d %H:%M:%S protocols: imaps ssl_cert_file: /home/xxxx/cacert/xxxx.net/server.crt ssl_key_file: /home/xxxx/cacert/xxxx.net/server.key verbose_ssl: yes login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/imap-login mail_privileged_group: mail mail_location: maildir:~/Maildir mbox_write_locks: fcntl dotlock auth default: mechanisms: plain login passdb: driver: pam userdb: driver: passwd socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix
用xxxx隐藏的实际值
root@xxxx:/etc/postfix# stat /var/spool/postfix/private/auth File: «/var/spool/postfix/private/auth» Size: 0 Blocks: 0 IO Block: 4096 socket Device: 801h/2049d Inode: 6817165 Links: 1 Access: (0660/srw-rw----) Uid: ( 111/ postfix) Gid: ( 120/ postfix) Access: 2012-08-10 16:47:06.000000000 +0200 Modify: 2012-08-10 16:46:09.000000000 +0200 Change: 2012-08-10 16:46:09.000000000 +0200
更新 :如果将smtpd_tls_auth_only = no更改为smtpd_tls_auth_only = yes , 则会删除该错误。 现在我可以从远程主机接收邮件到本地邮箱。
我必须configuration我的MUA连接到STARTTLS才能连接。 如果我尝试使用SSL / TLS进行连接,连接将挂起。 与STARTTLS,连接build立,但作为匿名,因此邮件中继被拒绝,这是我想启用。 这是我在syslog中看到的。
postfix/smtpd[7715]: connect from unknown[192.168.2.17] postfix/smtpd[7715]: setting up TLS connection from unknown[192.168.2.17] postfix/smtpd[7715]: Anonymous TLS connection established from unknown[192.168.2.17]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
尝试通过postfix服务器中继邮件时更新 dovecot auth_debug输出。 这可能是一个后缀configuration问题。
postfix/smtpd[8186]: connect from unknown[192.168.2.17] postfix/smtpd[8186]: setting up TLS connection from unknown[192.168.2.17] postfix/smtpd[8186]: Anonymous TLS connection established from unknown[192.168.2.17]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits) dovecot: auth(default): new auth connection: pid=8186 dovecot: auth(default): client in: AUTH#0111#011PLAIN#011service=smtp#011nologin#011lip=192.168.2.3#011rip=192.168.2.17#011secured#011resp=<hidden> home dovecot: auth-worker(default): pam(yyyy,192.168.2.17): lookup service=dovecot home dovecot: auth-worker(default): pam(yyyy,192.168.2.17): #1/1 style=1 msg=Password: home dovecot: auth(default): client out: OK#0111#011user=yyyy postfix/smtpd[8186]: NOQUEUE: reject: RCPT from unknown[192.168.2.17]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[192.168.2.17]> postfix/smtpd[8186]: disconnect from unknown[192.168.2.17]
这意味着postfix正确地与dovecot进行通信,并且我认为authentication是可行的,因为dovecot在事务结束时返回Ok。
发送到本地帐户的工作和我的MUA使用TLS的预期。 因此唯一的问题就是允许authentication用户的中继。 我以为
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
阅读后缀文档后就足够了。
解决scheme :注释smtpd_sender_restriction参数中继是可能的。 我通过逐个评论可疑的论点来find它。 我不知道什么可能阻止邮件中继。
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, reject_unauth_destination, reject_unauth_pipelining, reject_unknown_sender_domain regexp:/etc/postfix/forbid_from
我们可以用几个问题来解决这个问题:
/var/spool/postfix/private/auth是否有可用的套接字? 如果对这些问题的答案是“否”,我们发现你的问题。 如果答案都是“是”,请发表doveconf -n
我自己解决了这个问题。
导致继电器失败的参数是
smtpd_sender_restrictions = ..., reject_unauth_destination, ...
一旦被移除,对于saslauthentication的用户来说,可以进行中继。