免费注册 查看新帖 |

Chinaunix

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

[Mail] 求救:SASL LOGIN authentication failed [复制链接]

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-01 10:07 |显示全部楼层 |倒序浏览
5可用积分
遇到一个问题.不能通过客户端收发邮件,日志中出现.
Jan  1 10:01:34 localhost postfix/smtpd[4025]: warning: unknown[121.9.xxx.xx]: SASL LOGIN authentication failed: authentication failure

下面是我的postfix配置,麻烦各位指点一下.
root@mail postfix]# postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 14336000
mydomain = xxxx.com
myhostname = mail.xxxx.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:689
virtual_mailbox_base = /var/mailbox
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 20971520
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 89
virtual_transport = virtual
virtual_uid_maps = static:689

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2009-01-01 10:09 |显示全部楼层
很奇怪,我安装完sasl2后,没有smtpd.conf这个文件,于是,我自己建了一个,内容如下:

[root@mail /]# more /usr/local/sasl2/lib/sasl2/smtpd.conf
pwcheck_method:authdaemond
log_level: 3
mech_listLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
3 [报告]
发表于 2009-01-01 10:10 |显示全部楼层
[root@mail authlib]# more authmysqlrc
MYSQL_SERVER            localhost
MYSQL_USERNAME          extmail
MYSQL_PASSWORD          extmail
MYSQL_SOCKET           /var/lib/mysql/mysql.sock
MYSQL_PORT      3306
MYSQL_OPT               0
MYSQL_DATABASE         extmail
MYSQL_USER_TABLE          mailbox
MYSQL_CRYPT_PWFIELD      password
MYSQL_UID_FIELD          '689'
MYSQL_GID_FIELD         '689'
MYSQL_LOGIN_FIELD    username
MYSQL_HOME_FIELD      '/var/mailbox'
MYSQL_NAME_FIELD        name
MYSQL_MAILDIR_FIELD      '/var/mailbox'
MYSQL_QUOTA_FIELD quota
MYSQL_WHERE_CLAUSE active='1'
DEFAULT_DOMAIN xxxx.com

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
4 [报告]
发表于 2009-01-01 10:11 |显示全部楼层
[root@mail authlib]# more authdaemonrc|grep -v '^#'


authmodulelist="authmysql"


authmodulelistorig="authmysql"


daemons=10


authdaemonvar=/var/spool/authdaemon


DEBUG_LOGIN=2


DEFAULTOPTIONS=""


LOGGEROPTS=""
subsystem=mail

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
5 [报告]
发表于 2009-01-01 10:15 |显示全部楼层
testsaslauthd测试本机的用户名和密码能通过的

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
6 [报告]
发表于 2009-01-01 10:27 |显示全部楼层
但是用smtp  也不能认证
[root@mail authlib]# testsaslauthd -s smtp -u test@xxxx.com -p test123
0: NO "authentication failed"

Jan  1 10:23:07 localhost authdaemond: received auth request, service=login, authtype=login
Jan  1 10:23:07 localhost authdaemond: authmysql: trying this module
Jan  1 10:23:07 localhost authdaemond: SQL query: SELECT username., password., "", '89'., '89', concat('/var/mailbox/',homedir)., concat('/var/mailbox/',maildir)., "", name, "" FROM mailbox. WHERE username. = "test@xxxx.com"
Jan  1 10:23:07 localhost authdaemond: supplied password '-ptest123' does not match encrypted password '$1$KwaEyhc/$2mVDfXXiGzCuegrlHg1jT/'
Jan  1 10:23:07 localhost authdaemond: authmysql: REJECT - try next module
Jan  1 10:23:07 localhost authdaemond: FAIL, all modules rejected


奇怪,这个'89'., '89'是从那里来的呢?

重启authdaemond后, 上面的错误变成

Jan  1 10:31:03 localhost authdaemond: modules="authmysql", daemons=10
Jan  1 10:31:03 localhost authdaemond: Installing libauthmysql
Jan  1 10:31:03 localhost authdaemond: Installation complete: authmysql


看来个'89'., '89' 是未重启authdaemond造成的

[ 本帖最后由 yuantong 于 2009-1-1 10:42 编辑 ]

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
7 [报告]
发表于 2009-01-01 12:18 |显示全部楼层
[root@mail ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 Welcome to our mail.xxxx.com ESMTP,Warning: Version not Available!
ehlo xxxx.com
250-mail.xxxx.com
250-PIPELINING
250-SIZE 14336000
250-VRFY
250-ETRN
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
dGVzdEAzY29vYy5jb20AdGVzdA==
334 UGFzc3dvcmQ6
dGVzdEAzY29vYy5jb20AdGVzdDEyMw==
535 5.7.8 Error: authentication failed: authentication failure

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
8 [报告]
发表于 2009-01-01 20:41 |显示全部楼层
楼上的兄弟,你不见我重启过authdaemond

你所帖的错误已经解决了吗?

现在的错误是
535 5.7.8 Error: authentication failed: authentication failure

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
9 [报告]
发表于 2009-01-02 10:16 |显示全部楼层
谢谢ruochen 的回答

telnet的时候,我的maillog日志是

Jan  2 10:16:03 localhost postfix/smtpd[9669]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Jan  2 10:16:03 localhost postfix/smtpd[9669]: connect from localhost.localdomain[127.0.0.1]
Jan  2 10:16:31 localhost postfix/smtpd[9669]: warning: localhost.localdomain[127.0.0.1]: SASL LOGIN authentication failed: authentication failure
没有再报密码不对的错误了.

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
10 [报告]
发表于 2009-01-02 10:19 |显示全部楼层
我安装所用的包
Postfix-2.4.5
Mysql-5.0.45
Sasl-2.1.22
DB-4.5.20
Openssl-0.98e
httpd-2.2.4
Php-5.2.3
courier-authlib-0.59.3
courier-imap-4.1.3
Extmail-1.0.2
Extman-0.2.2
maildrop-2.0.4

基本上都是按照CU上的精华帖来配置的.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP