This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.

User Databases

After a user has been successfully authenticated, Dovecot looks up the user's userdb information. The userdb lookup is also done by LDA to find out how to deliver mails for the user.

The user database lookup returns these fields:

The user and password databases may be the same or they may be different depending on your needs. You can also have multiple databases.

Currently supported user databases are:

Userdb settings

An example userdb entry might look like this:

userdb {
  driver = passwd-file
  args = username_format=%n /etc/dovecot/users

  default_fields = uid=vmail gid=vmail
  override_fields = 

  # v2.2.10+:
  skip = never
  result_failure = continue
  result_internalfail = continue
  result_success = return-ok

First we have the settings that provide content for the userdb lookup:

Then we have the setting which specify when the userdb is used (v2.2.10+):

And finally we can control what happens when we're finished with this userdb (v2.2.10+):

result_success: What to do if the user was found from the userdb (default: return-ok) result_failure: What to do if the user wasn't found from the userdb (default: continue) result_internalfail: What to do if the userdb lookup had an internal failure (default: continue). If any of the userdbs had an internal failure and the final userdb also returns "continue", the lookup will fail with "internal error". WARNING: If multiple userdbs are required (results are merged), it's important to set result_internalfail=return-fail to them, otherwise the userdb lookup could still succeed but not all the intended extra fields are set.

The result values that can be used:

return-ok: Return success, don't continue to the next userdb. return-fail: Return "user doesn't exist", don't continue to the next userdb. return: Return earlier userdb's success or failure, don't continue to the next userdb. If this was the first userdb, return "user doesn't exist". continue-ok: Set the current user existence state to "found", and continue to the next userdb. continue-fail: Set the current user existence state to "not found", and continue to the next userdb. continue: Continue to the next userdb without changing the user existence state. The initial state is "not found".