Migrating to new dovecot server; Dovecot fails to authenticate using old password database

authenticationdovecotubuntu-12.04

I am migrating my companies intranet from a OS X server to an Ubuntu 12.04 server. We use a flat file to store user names and passwords hashs. This file is used by Apache and Dovecot to authenticate users. The Ubuntu server is running Dovecot 2.0 while the OS X server is running Dovecot 1.2.

I have already migrated WebDav which uses Apache for authentication. Authentication works. I'm in the process of migrating our Prosody server which uses Dovecot for authentiation. Dovecot is up and running, but when I test authentication using either telnet a login username password or doveadm sudo doveadm auth username, I get dovecot: auth: passwd-file(username): unknown user

dovecot: auth: Debug: client out: FAIL#0111#011user=username in my log file.

I can use sudo dovecot user username to perform a user lookup and it will return the user's info. I can generate a password hash locally and Dovecot will authenticate the test password just fine.

Edit: The scheme is set at CRYPT which is the default aways.

Edit the second: Here's what I have in 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
}

How the password file looks:

username:userpasswordhash:

Best Answer

Dovecot supports several password encryption schemes. Some require plain text passwords to be exchanged. Dovecot 2.0 prefixes passwords with the scheme such as {SSHA256}. You can specify a default scheme when you specify the file.

I found I needed to specify the auth_username_format when I upgraded. Configurations like the following may help.

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