User Databases ============== After a user has been successfully authenticated, Dovecot looks up the user's userdb information. The userdb lookup is also done by to find out how to deliver mails for the user. The user database lookup returns these fields: * *uid*: User's [UserIds.txt] (UNIX user ID), overrides the global 'mail_uid' setting. * *gid*: User's [UserIds.txt] (UNIX group ID), overrides the global 'mail_gid' setting. * *home*: User's [VirtualUsers.Home.txt], overrides the global 'mail_home' setting. Although not required, it's [VirtualUsers.Home.txt]. * *mail*: [MailLocation.txt], overrides the global 'mail_location' setting. * Optional [UserDatabase.ExtraFields.txt], which can be used for example: * Overwriting all mail-related settings (e.g. quota_rule to specify per-user quota limit) * The extra fields are also passed to [PostLoginScripting.txt] The user and [PasswordDatabase.txt] may be the same or they may be different depending on your needs. You can also have [Authentication.MultipleDatabases.txt]. Currently supported user databases are: * [AuthDatabase.Passwd.txt]: System users (NSS, '/etc/passwd', or similiar) * [AuthDatabase.PasswdFile.txt]: '/etc/passwd'-like file in specified location * [UserDatabase.NSS.txt]: Name Service Switch * [AuthDatabase.LDAP.txt]: Lightweight Directory Access Protocol * [AuthDatabase.SQL.txt]: SQL database (PostgreSQL, MySQL, SQLite) * [AuthDatabase.Dict.txt]: Dict key-value database (Redis, memcached, etc.) * [UserDatabase.Static.txt]: Userdb information generated from a given template * [AuthDatabase.VPopMail.txt]: External software used to handle virtual domains * [UserDatabase.Prefetch.txt]: This assumes that the passdb already returned also all the required user database information 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 = } ---%<------------------------------------------------------------------------- Here you have settings: * driver: The userdb backend name * args: Arguments for the userdb backend. The format of this value depends on the userdb driver. Each one uses different args. * default_fields: Userdb fields (and [UserDatabase.ExtraFields.txt]) that are used, unless overwritten by the userdb backend. They are in format 'key=value key2=value2 ...'. The values can contain <%variables> [Variables.txt]. * override_fields: Same as default_fields, but instead of providing the default values, these values override what the userdb backend returned. For example useful with [AuthDatabase.Passwd.txt] for overriding e.g. home directory or the uid/gid. (This file was created from the wiki on 2013-11-24 04:43)