迁移到新的 dovecot 服务器;Dovecot 无法使用旧密码数据库进行身份验证

迁移到新的 dovecot 服务器;Dovecot 无法使用旧密码数据库进行身份验证

我正在将公司的内部网从 OS X 服务器迁移到 Ubuntu 12.04 服务器。我们使用一个平面文件来存储用户名和密码哈希值。Apache 和 Dovecot 使用此文件对用户进行身份验证。Ubuntu 服务器运行的是 Dovecot 2.0,而 OS X 服务器运行的是 Dovecot 1.2。

我已经迁移了使用 Apache 进行身份验证的 WebDav。身份验证有效。我正在迁移使用 Dovecot 进行身份验证的 Prosody 服务器。Dovecot 已启动并运行,但当我使用 telnet 或a login username passworddoveadm测试身份验证时sudo doveadm auth username,我得到了dovecot: auth: passwd-file(username): unknown user

dovecot: auth: Debug: client out: FAIL#0111#011user=username在我的日志文件中。

我可以用来sudo dovecot user username执行用户查找,它会返回用户的信息。我可以在本地生成密码哈希,Dovecot 会很好地验证测试密码。

编辑:该方案设置为 CRYPT,这是默认设置。

编辑第二个:这是我在 auth-passwdfile.conf.ext 中的内容:

# Authentication for passwd-file users. Included from auth.conf.
#
# passwd-like file with specified location.
# <doc/wiki/AuthDatabase.PasswdFile.txt>

passdb {
  driver = passwd-file
  args = scheme=CRYPT username_format=%u /srv/auth/passwd/passwd.intranet
}

userdb {
  driver = passwd-file
  args = username_format=%u /srv/auth/passwd/passwd.intranet
}

密码文件的样子:

username:userpasswordhash:

答案1

Dovecot 支持多种密码加密方案。有些方案要求交换纯文本密码。Dovecot 2.0 在密码前加上以下方案,例如{SSHA256}。您可以在指定文件时指定默认方案。

我发现升级时需要指定 auth_username_format。类似下面的配置可能会有帮助。

auth_username_format=%n
mechanisms = plain login
# passwd-like file with specified location
passdb passwd-file {
    args = scheme=plain-md5 /etc/dovecot/passwd.md5
}

答案2

我的问题是密码文件格式。它本来就在它应该在的地方。多余的冒号划定了 Dovecot 认为应该在那里的空字段。我猜新版本的 Dovecot 比旧版本更挑剔。username:passwordhash:[email protected]username:passwordhash::::::[email protected]

相关内容