求助:authdaemond: supplied password does not match encrypted password
very_99
求助:authdaemond: supplied password does not match encrypted password
[font=宋体][size=5][color=Red][b]从postfixadmin上用邮件帐户登陆是可以的,但是从客户端怎么就不行了呢[/b][/color][/size][/font]
[code]RedHat Enterprise Linux Server 4.2 + Postfix + PostfixAdmin + MySQL + Cyrus-sasl + Courier-authlib + Dovecot [/code]
已经使用postfixadmin 建立了 [email]alan@yahoo.lt[/email] 的 用户和邮箱,OUTLOOK客户端 使用用户名[email]alan@yahoo.lt[/email] ,输入密码后无法登陆.
查看maillog记录
[code]Sep 26 21:17:00 mail postfix/smtpd[15526]: connect from unknown[192.168.77.11]
Sep 26 21:17:00 mail authdaemond: received auth request, service=smtp, authtype=login
Sep 26 21:17:00 mail authdaemond: authmysql: trying this module
Sep 26 21:17:00 mail authdaemond: SQL query: SELECT username, password, "", '102', '104', concat('/home/mailbox/',maildir), concat('/home/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = "alan@yahoo.lt"
Sep 26 21:17:00 mail authdaemond: supplied password does not match encrypted password
Sep 26 21:17:00 mail authdaemond: authmysql: REJECT - try next module
Sep 26 21:17:00 mail authdaemond: FAIL, all modules rejected
Sep 26 21:17:00 mail postfix/smtpd[15526]: warning: unknown[192.168.77.11]: SASL LOGIN authentication failed
Sep 26 21:17:00 mail postfix/smtpd[15526]: lost connection after AUTH from unknown[192.168.77.11]
Sep 26 21:17:00 mail postfix/smtpd[15526]: disconnect from unknown[192.168.77.11][/code]
OUTLOOK客户端 使用用户名[email]alan@yahoo.lt[/email] ,输入密码后无法登陆.
同时mysql收到命令
[code]SELECT username, password, "", '102', '104', concat('/home/mailbox/',maildir), concat('/home/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = "alan@yahoo.lt"
SELECT password FROM mailbox WHERE username = 'alan@yahoo.lt'[/code]
使用此命令在mysql上可以查到
[code]mysql> SELECT username, password, "", '102', '104', concat('/home/mailbox/',maildir), concat('/home/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = "alan@yahoo.lt"
-> ;
+---------------+----------+--+-----+-----+----------------------------------+----------------------------------+--+------+--+
| username | password | | 102 | 104 | concat('/home/mailbox/',maildir) | concat('/home/mailbox/',maildir) | | name | |
+---------------+----------+--+-----+-----+----------------------------------+----------------------------------+--+------+--+
| [email]alan@yahoo.lt[/email] | alan | | 102 | 104 | /home/mailbox/yahoo.lt/alan/ | /home/mailbox/yahoo.lt/alan/ | | | |
+---------------+----------+--+-----+-----+----------------------------------+----------------------------------+--+------+--+
1 row in set (0.00 sec)
mysql> SELECT password FROM mailbox WHERE username = 'alan@yahoo.lt';
+----------+
| password |
+----------+
| alan |
+----------+
1 row in set (0.00 sec)[/code]
[[i] 本帖最后由 very_99 于 2007-9-27 18:56 编辑 [/i]]
marion
呵呵,祝贺你!原因应该是courier-authlib考虑到安全问题,强制认证时用户的UID大于500。
very_99
为什么还是说我
authdaemond: supplied password does not match encrypted password
查到密码和我客户端输入的密码是一致的
marion
在outlook中打开使用认证的功能,并确保你认证时使用的用户名为[email]alan@yahoo.lt[/email],密码对应即可。
very_99
"在outlook中打开使用认证的功能" 什么意思?
你在另外个帖子里让我 #service saslauthd start;
有什么作用呢?
marion
courier-authlib会使用你指定sasl来进行用户认证,其实不需要启动saslauthd进程,我只是想让你开启确定一下的确不是这儿的问题。
outlook中的认证功能等我发图给你。
marion
这个是第一步,注意看圈着的那些:
[attach]215250[/attach]
这里要填上你的用户名和密码,用户名为全写,如:[email]user@domain.lt[/email]
[attach]215251[/attach]
very_99
我选了. 现在感觉连POP3的验证也不能通过.
没有使用数据库做sasl验证的时候没出现问题. 现在比较迷茫
辛苦了 谢谢啊 :em02:
marion
没关系,邮于对问题的兴趣,呵呵。
你重启下courier-authlib和postifx的进程,而后再登录一次,把相关的日志发上来。
very_99
[code][root@mail ~]# service courier-authlib restart
Stopping Courier authentication services: authdaemond
Starting Courier authentication services: authdaemond
[root@mail ~]# service postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ][/code]
[code]Sep 26 22:05:24 mail authdaemond: stopping authdaemond children
Sep 26 22:05:24 mail authdaemond: modules="authmysql", daemons=10
Sep 26 22:05:24 mail authdaemond: Installing libauthmysql
Sep 26 22:05:24 mail authdaemond: Installation complete: authmysql
Sep 26 22:05:33 mail postfix/postfix-script: stopping the Postfix mail system
Sep 26 22:05:33 mail postfix/master[14514]: terminating on signal 15
Sep 26 22:05:34 mail postfix/postfix-script: starting the Postfix mail system
Sep 26 22:05:34 mail postfix/master[15696]: daemon started -- version 2.2.5, configuration /etc/postfix[/code]
客户端连接一下
[code]Sep 26 22:07:23 mail postfix/smtpd[15703]: connect from unknown[192.168.77.11]
Sep 26 22:07:23 mail authdaemond: received auth request, service=smtp, authtype=login
Sep 26 22:07:23 mail authdaemond: authmysql: trying this module
Sep 26 22:07:23 mail authdaemond: SQL query: SELECT username, password, "", '102', '104', concat('/home/mailbox/',maildir), concat('/home/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = "alan@yahoo.lt"
Sep 26 22:07:23 mail authdaemond: supplied password does not match encrypted password
Sep 26 22:07:23 mail authdaemond: authmysql: REJECT - try next module
Sep 26 22:07:23 mail authdaemond: FAIL, all modules rejected
Sep 26 22:07:23 mail postfix/smtpd[15703]: warning: unknown[192.168.77.11]: SASL LOGIN authentication failed
Sep 26 22:07:23 mail postfix/smtpd[15703]: lost connection after AUTH from unknown[192.168.77.11]
Sep 26 22:07:23 mail postfix/smtpd[15703]: disconnect from unknown[192.168.77.11][/code]
marion
你把postfix用户的UID和GID改大一些(大于500),再试一次;别忘了改authmysql中的对应的部分;
very_99
回复 #1 very_99 的帖子
[font=宋体][size=5][color=Red][b]从postfixadmin上用邮件帐户登陆是可以的,但是从客户端怎么就不行了呢[/b][/color][/size][/font]
very_99
改大了 开POSTFIX没权限了
........
very_99
[quote]原帖由 [i]marion[/i] 于 2007-9-27 18:57 发表 [url=http://bbs.chinaunix.net/redirect.php?goto=findpost&pid=7411581&ptid=997148][img]http://bbs.chinaunix.net/images/common/back.gif[/img][/url]
你把postfix用户的UID和GID改大一些(大于500),再试一次;别忘了改authmysql中的对应的部分; [/quote]
改了之后发出去了哦!
[code]Sep 26 23:01:28 mail postfix/smtpd[17208]: connect from unknown[192.168.77.11]
Sep 26 23:01:28 mail authdaemond: received auth request, service=smtp, authtype=login
Sep 26 23:01:28 mail authdaemond: authmysql: trying this module
Sep 26 23:01:28 mail authdaemond: SQL query: SELECT username, password, "", '510', '510', concat('/home/mailbox/',maildir), concat('/home/mailbox/',maildir), "", name, "" FROM mailbox WHERE username = "alan@yahoo.lt"
Sep 26 23:01:28 mail authdaemond: password matches successfully
Sep 26 23:01:28 mail authdaemond: authmysql: sysusername=<null>, sysuserid=510, sysgroupid=510, homedir=/home/mailbox/yahoo.lt/alan/, address=alan@yahoo.lt, fullname=<null>, maildir=/home/mailbox/yahoo.lt/alan/, quota=<null>, options=<null>
Sep 26 23:01:28 mail authdaemond: Authenticated: sysusername=<null>, sysuserid=510, sysgroupid=510, homedir=/home/mailbox/yahoo.lt/alan/, address=alan@yahoo.lt, fullname=<null>, maildir=/home/mailbox/yahoo.lt/alan/, quota=<null>, options=<null>
Sep 26 23:01:28 mail postfix/smtpd[17208]: 4D05AC1592: client=unknown[192.168.77.11], sasl_method=LOGIN, sasl_username=alan@yahoo.lt
Sep 26 23:01:28 mail postfix/cleanup[17212]: 4D05AC1592: message-id=<002e01c800f8$36ffc3c0$6158a8c0@FuJiTs>
Sep 26 23:01:28 mail postfix/qmgr[17076]: 4D05AC1592: from=<[email]alan@yahoo.lt[/email]>, size=1337, nrcpt=1 (queue active)
Sep 26 23:01:28 mail postfix/smtpd[17208]: disconnect from unknown[192.168.77.11]
Sep 26 23:01:28 mail postfix/virtual[17214]: 4D05AC1592: to=<[email]ding@yahoo.lt[/email]>, relay=virtual, delay=0, status=sent (delivered to maildir)
Sep 26 23:01:28 mail postfix/qmgr[17076]: 4D05AC1592: removed[/code]
[color=Red]接收时候出了个问题
[code]Sep 26 23:00:10 mail dovecot: Logins with UID 102 (user [email]alan@yahoo.lt[/email]) not permitted (modify first_valid_uid in config file)
Sep 26 23:00:10 mail pop3-login: Internal login failure: [email]alan@yahoo.lt[/email] [::ffff:192.168.77.11]
[/code][/color]
你真强啊 不服你不行啊
marion
Sep 26 23:00:10 mail dovecot: [color=Red]Logins with UID 102 [/color](user [email]alan@yahoo.lt[/email]) not permitted (modify first_valid_uid in config file)
Sep 26 23:00:10 mail pop3-login: Internal login failure: [email]alan@yahoo.lt[/email] [::ffff:192.168.77.11]
这里的UID也要改,查一下相关的部分,改作你后来为postfix定义的UID。
very_99
我在dovecot.conf里面该了
[code]first_valid_uid = 500[/code]
目前
[code][root@mail home]# id postfix
uid=510(postfix) gid=510(postfix) groups=510(postfix),12(mail)[/code]
日志
[code]Sep 26 23:13:00 mail dovecot: Logins with UID 102 (user [email]alan@yahoo.lt[/email]) not permitted (modify first_valid_uid in config file)
Sep 26 23:13:00 mail pop3-login: Internal login failure: [email]alan@yahoo.lt[/email] [::ffff:192.168.77.11][/code]
mysql
[code]114 Query SELECT password FROM mailbox WHERE username = 'alan@yahoo.lt'
114 Query SELECT maildir, 102 AS uid, 104 AS gid FROM mailbox WHERE username = 'alan@yahoo.lt'[/code]
[color=Red]然后改了
[code]
[root@mail home]# vi /etc/dovecot-mysql.conf
db_host = localhost
db_port = 3306
db_unix_socket = /var/lib/mysql/mysql.sock
db = postfix
db_user = postfix
然后改了
[code]
[root@mail home]# vi /etc/dovecot-mysql.conf
db_host = localhost
db_port = 3306
db_unix_socket = /var/lib/mysql/mysql.sock
db = postfix
db_user = postfix
db_passwd = postfix
db_client_flags = 0
default_pass_scheme = PLAIN-MD5
password_query = SELECT password FROM mailbox WHERE username = '%u'
user_query = SELECT maildir, 510 AS uid, 510 AS gid FROM mailbox WHERE username = '%u'
[/code]db_passwd = postfix
db_client_flags = 0
default_pass_scheme = PLAIN-MD5
password_query = SELECT password FROM mailbox WHERE username = '%u'
user_query = SELECT maildir, 510 AS uid, 510 AS gid FROM mailbox WHERE username = '%u'
[/code][/color]
成功了!
再拜托你讲一下我这个故障的原因吧
very_99
一? 都成功的 收不到信啊
Sep 26 23:19:39 mail pop3-login: Login: [email]alan@yahoo.lt[/email] [::ffff:192.168.77.11]
Sep 26 23:19:40 mail pop3-login: Login: [email]ding@yahoo.lt[/email] [::ffff:192.168.77.11]
very_99
几个后续的小问题:
1.目前验证的时候用户名需要输入[email]alan@yahoo.lt[/email]而不是alan就行了,如何解决呢
2.主机的域名和虚拟的域民一样会怎样呢?
3.还有就是目前收不到信,我自己查查
marion
第二个问题,本地域和虚拟域一样时,虚拟域的用户的确收不到信的,因为那个发往本地域了;
没准儿第三个问题的原因就在这里。