我将我的公司内部网从OS X服务器迁移到Ubuntu 12.04服务器。 我们使用一个平面文件来存储用户名和密码哈希。 这个文件被Apache和Dovecot用来validation用户。 Ubuntu服务器运行Dovecot 2.0,而OS X服务器运行Dovecot 1.2。
我已经迁移了使用Apache进行authentication的WebDav。 authentication工作。 我正在迁移使用Dovecot进行authentication的Prosody服务器。 Dovecot正在运行,但是当我使用telnet a login username password或doveadm sudo doveadm auth username来testing身份validation时,我得到了dovecot: auth: passwd-file(username): unknown user
dovecot: auth: Debug: client out: FAIL#0111#011user=username我的日志文件中的dovecot: auth: Debug: client out: FAIL#0111#011user=username 。
我可以使用sudo dovecot user username执行用户查找,它将返回用户的信息。 我可以在本地生成密码哈希,Dovecot会validationtesting密码就好了。
编辑:该scheme设置为默认的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:
Dovecot支持多种密码encryptionscheme。 有些需要纯文本密码进行交换。 Dovecot 2.0在scheme中encryption前缀{SSHA256} 。 指定文件时,可以指定默认scheme。
我发现我升级时需要指定auth_username_format。 像下面的configuration可能会有所帮助。
auth_username_format=%n mechanisms = plain login # passwd-like file with specified location passdb passwd-file { args = scheme=plain-md5 /etc/dovecot/passwd.md5 }
我的问题是密码文件格式。 这是username:passwordhash:[email protected]它应该是username:passwordhash::::::[email protected] 。 额外的冒号划分了Dovecot希望在那里的空场。 我猜Dovecot的新版本比旧版本更挑剔。