大网数据广告活动
服务器运维问答

Dovecot IMAP authentication failed

· 52CE 我爱测

Whenever I'm trying to connect to my Dovecot IMAP server, it gives me a message that the authentication was failed. This message is from the /var/log/mail.log file: Feb 7 15:22:17 celestine dovecot: imap-login: Disconnected (auth…

问题原文

原帖链接 · dengsn · CC BY-SA 3.0

Whenever I'm trying to connect to my Dovecot IMAP server, it gives me a message that the authentication was failed. This message is from the /var/log/mail.log file:

Feb  7 15:22:17 celestine dovecot: imap-login: Disconnected (auth failed, 1 attempts in 2 secs): user=<celestine>, method=PLAIN, rip=::1, lip=::1, TLS, session=<QsPvvtbx5AAAAAAAAAAAAAAAAAAAAAAB>

I tried connecting with the Roundcube webmail program, bit in the IMAP log it says the following:

[07-Feb-2014 15:22:15 -0500]: [A4F2] S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.
[07-Feb-2014 15:22:15 -0500]: [A4F2] C: A0001 ID ("name" "Roundcube" "version" "0.9.5" "php" "5.4.4-14+deb7u7" "os" "Linux" "command" "/")
[07-Feb-2014 15:22:15 -0500]: [A4F2] S: * ID NIL
[07-Feb-2014 15:22:15 -0500]: [A4F2] S: A0001 OK ID completed.
[07-Feb-2014 15:22:15 -0500]: [A4F2] C: A0002 AUTHENTICATE PLAIN AGNlbGVzdGluZQAxMDA5OTU=
[07-Feb-2014 15:22:17 -0500]: [A4F2] S: A0002 NO [AUTHENTICATIONFAILED] Authentication failed.

If I try to connect with another program, it also won't work.

I have SSL enabled so my IMAP server is running on port 993. The following is my /etc/dovecot/dovecot.conf:

disable_plaintext_auth = no
mail_privileged_group = mail
mail_location = mbox:~/mail:INBOX=/var/mail/%u
userdb {
  driver = passwd
}
passdb {
  driver = passwd
}

protocols = "imap"

protocol imap {
  mail_plugins = " autocreate"
}
plugin {
  autocreate = Trash
  autocreate2 = Sent
  autosubscribe = Trash
  autosubscribe2 = Sent
}

service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}

ssl = required
ssl_cert = </etc/ssl/localcerts/mail.pem
ssl_key = </etc/ssl/localcerts/mail.key

I'm using Debian Squeeze with Postfix installed.

已采纳解答

原帖链接 · Megodin · CC BY-SA 3.0

Firstly I assume that user celestine (with password 100995) is set up correctly in your system (simply check if a login is successful with no further errors / warnings).

According to your dovecot.conf, you set up your server authentication process using Lookup databases with passwd. That's fine as User Database, but with passwd as Password Database you can't get the user's password on Debian, as stated in the official Dovecot documentation:

hxxp://wiki2.dovecot.org/AuthDatabase/Passwd :

Most commonly used as a user database. Many systems use shadow passwords nowadays so it doesn't usually work as a password database.

You can work around this problem with

passdb {
  driver = shadow
}

Another possiblity would be using passdb with Passwd-file, but I recommend you set up your Dovecot authenticate system using PAM.

Good luck, Megodin

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-02-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。