This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.
Differences between revisions 10 and 12 (spanning 2 versions)
Revision 10 as of 2007-07-22 08:04:15
Size: 1439
Editor: TimoSirainen
Comment:
Revision 12 as of 2008-01-01 14:35:29
Size: 1442
Editor: odnb-4d0aa5f5
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Currently the fallbacking works only with PLAIN authentication mechanism. Currently the fallback works only with PLAIN authentication mechanism.
Line 7: Line 7:
Often you also want different mail location for system and virtual users. The best way to do this would be to always have mails stored under home directory ({{{mail_location = ~/Maildir}}}), but if this isn't possible you can do this by pointing [:MailLocation:mail_location] to system users' mail location and have the virtual userdb override it by returning {{{mail}}} [:UserDatabase/ExtraFields:extra field]. Often you also want a different mail location for system and virtual users. The best way to do this would be to always have mails stored below the home directory ({{{mail_location = ~/Maildir}}}), but if this isn't possible you can do this by pointing [:MailLocation:mail_location] to system users' mail location and have the virtual userdb override it by returning {{{mail}}} [:UserDatabase/ExtraFields:extra field].

Multiple Authentication Databases

Dovecot supports defining multiple authentication databases, so that if the password doesn't match in the first database, it checks the next one. This can be useful if you want to easily support having both local system users in /etc/passwd and virtual users.

Currently the fallback works only with PLAIN authentication mechanism.

Often you also want a different mail location for system and virtual users. The best way to do this would be to always have mails stored below the home directory (mail_location = ~/Maildir), but if this isn't possible you can do this by pointing [:MailLocation:mail_location] to system users' mail location and have the virtual userdb override it by returning mail [:UserDatabase/ExtraFields:extra field].

Example

dovecot.conf:

auth default {
  mechanisms = plain

  # try to authenticate using SQL database first
  passdb sql {
    args = /etc/dovecot-sql.conf
  }
  # fallback to PAM
  passdb pam {
  }

  # look up users from SQL first (even if authentication was done using PAM!)
  userdb sql {
    args = /etc/dovecot-sql.conf
  }
  # if not found, fallback to /etc/passwd
  userdb passwd {
  }
}

dovecot-sql.conf:

password_query = SELECT userid as user, password FROM users WHERE userid = '%u'
user_query = SELECT uid, gid, '/var/vmail/%u' as mail FROM users WHERE userid = '%u'

None: Authentication/MultipleDatabases (last edited 2019-09-11 14:00:18 by MichaelSlusarz)