"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "dovecot-1.0.15/doc/wiki/Authentication.MultipleDatabases.txt" of archive dovecot-1.0.15.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 
    2 
    3 Multiple Authentication Databases
    4 =================================
    5 
    6 
    7 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. 
    8 Currently the fallbacking works only with PLAIN authentication mechanism. 
    9 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 >>mail_location<< to system users' mail location and have the virtual userdb override it by returning 'mail' >>extra field<<. 
   10 
   11 
   12 Example
   13 =======
   14 
   15 
   16 dovecot.conf: 
   17 
   18 ---%<-------------------------------------------------------------------------
   19 auth default {
   20   mechanisms = plain
   21 
   22   # try to authenticate using SQL database first
   23   passdb sql {
   24     args = /etc/dovecot-sql.conf
   25   }
   26   # fallback to PAM
   27   passdb pam {
   28   }
   29 
   30   # look up users from SQL first (even if authentication was done using PAM!)
   31   userdb sql {
   32     args = /etc/dovecot-sql.conf
   33   }
   34   # if not found, fallback to /etc/passwd
   35   userdb passwd {
   36   }
   37 }
   38 ---%<-------------------------------------------------------------------------
   39 
   40 dovecot-sql.conf: 
   41 
   42 ---%<-------------------------------------------------------------------------
   43 password_query = SELECT userid as user, password FROM users WHERE userid = '%u'
   44 user_query = SELECT uid, gid, '/var/vmail/%u' as mail FROM users WHERE userid = '%u'
   45 ---%<-------------------------------------------------------------------------
   46 
   47 (This file was created from the wiki on 2007-12-11 04:42)