免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 13317 | 回复: 1
打印 上一主题 下一主题

[Mail] 【已解决】SASL LOGIN authentication failed: authentication failure [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-26 17:51 |只看该作者 |倒序浏览
我使用sasl验证smtp用户。但是失败了。日志如下。
Feb 26 18:47:33 centos5postfix postfix/smtpd[16481]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Feb 26 18:47:33 centos5postfix postfix/smtpd[16481]: connect from unknown[192.168.0.111]
Feb 26 18:47:36 centos5postfix postfix/smtpd[16481]: warning: unknown[192.168.0.111]: SASL LOGIN authentication failed: authentication failure
Feb 26 18:47:36 centos5postfix postfix/smtpd[16481]: lost connection after AUTH from unknown[192.168.0.111]
Feb 26 18:47:36 centos5postfix postfix/smtpd[16481]: disconnect from unknown[192.168.0.111]
Feb 26 18:47:48 centos5postfix postfix/smtpd[16481]: connect from unknown[192.168.0.111]
Feb 26 18:47:50 centos5postfix postfix/smtpd[16481]: warning: unknown[192.168.0.111]: SASL LOGIN authentication failed: authentication failure
Feb 26 18:47:50 centos5postfix postfix/smtpd[16481]: lost connection after AUTH from unknown[192.168.0.111]
Feb 26 18:47:50 centos5postfix postfix/smtpd[16481]: disconnect from unknown[192.168.0.111]

通过以下的命令,我可以认为我的sasl是没问题的。
[root@centos5postfix mailbox]# testsaslauthd -s smtp -u chen@centos5postfix.orlab-dev.jp -p 123456789
0: OK "Success."
[root@centos5postfix mailbox]# testsaslauthd -s smtp -u chen@centos5postfix.orlab-dev.jp -p 1234567890
0: NO "authentication failed"
[root@centos5postfix mailbox]#

我的main.cf相关设定:
#====================SASL========================
smtpd_sasl_auth_enable = yes
smtpd_sasl_application_name=smtp
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination


谢谢。

[ 本帖最后由 ncowboy 于 2009-2-27 10:11 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-02-27 09:11 |只看该作者
[root@centos5postfix sasl2]# cat /etc/sysconfig/saslauthd |grep FLAGS
FLAGS="-r"
[root@centos5postfix sasl2]#

http://www.wains.be/index.php/20 ... -postfix-smtp-auth/
===
Edit 15 dec 2006 :
IMPORTANT NOTICE FOR RHEL/CENTOS 4 USERS

I’m currently installing a mail server under CentOS 4.4 while this guide describes the CentOS 3 way
I thought it did not matter but there’s a small difference with saslauthd..

Under CentOS 4.x you need to add the following line in /etc/sysconfig/saslauthd :

FLAGS="-r"

Without the -r flag, saslauthd would query the MySQL database this way :

25 Query SELECT password FROM mailbox WHERE username = 'admin'

Obviously, the whole email address is stored in the database, with the -r flag, it will query correctly :

26 Query SELECT password FROM mailbox WHERE username = 'admin@example.org'

The man page for saslauthd mentions the -r flag under CentOS 4 only..

-r Combine the realm with the login (with an ’@’ sign in between). e.g. login: “foo” realm: “bar” will get passed as login: “foo@bar”. Note that the realm will still be passed, which may lead to unexpected behavior.
===
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP