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

Passwd-file

This file is compatible with a normal /etc/passwd file, and a password file used by libpam-pwdfile [wiki:PasswordDatabase/PAM PAM] plugin. It's in the following format:

user:password:uid:gid:(gecos):home:(shell):extra_fields

For a password database it's enough to have only the user and password fields. For a user database, you need to set also uid, gid and preferably also home (see VirtualUsers). (gecos) and (shell) fields are unused by Dovecot.

The password field can be in three formats:

extra_fields is a space-separated list of key=value pairs which can be used to set various [wiki:PasswordDatabase/ExtraFields passdb settings] and [wiki:UserDatabase/ExtraFields userdb settings]. Keys which begin with a userdb_ prefix are used for userdb, others are used for passdb. So for example if you wish to override [wiki:MailLocation mail_location] setting for one user, use userdb_mail=mbox:~/mail.

Examples

This file can be used as a passdb:

user:{plain}password
user2:{plain}password2

This file can be used as both a passwd and a userdb:

user:{plain}pass:1000:1000::/home/user::userdb_mail=maildir:~/Maildir allow_nets=192.168.0.0/24
user2:{plain}pass2:1001:1001::/home/user2