|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/doc/dovecot-1.0.7/wiki/ |
Upload File : |
Prefetch User Database
======================
Prefetch userdb can be used to combine passdb and userdb lookups into a single
lookup. It's usually used with<SQL> [AuthDatabase.SQL.txt], <LDAP>
[AuthDatabase.LDAP.txt] and <checkpassword>
[PasswordDatabase.CheckPassword.txt] passdbs.
Prefetch basically works by requiring that the passdb returns the userdb
information in<extra fields> [PasswordDatabase.ExtraFields.txt] with 'userdb_'
prefixes. For example if a userdb typically returns 'uid', 'gid' and 'home'
fields, the passdb would have to return 'userdb_uid', 'userdb_gid' and
'userdb_home' fields.
If you're using <deliver> [LDA.txt], you still need a valid userdb which can be
used to locate the users. You can do this by adding a normal SQL/LDAP userdb
after the userdb prefetch. See below for examples.
LDAP's 'auth_bind_userdn=yes' setting is incompatible with prefetch, because no
passdb lookup is done then. If you want zero LDAP lookups, you might want to
user<static userdb> [UserDatabase.Static.txt] instead of prefetch.
SQL example
-----------
'dovecot.conf':
---%<-------------------------------------------------------------------------
passdb sql {
args = /etc/dovecot-sql.conf
}
userdb prefetch {
}
# The userdb below is used only by deliver.
userdb sql {
args = /etc/dovecot-sql.conf
}
---%<-------------------------------------------------------------------------
'dovecot-sql.conf':
---%<-------------------------------------------------------------------------
# NOTE: '\' line splitting is used only for readability, currently Dovecot
doesn't support it
password_query = SELECT password, \
home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
FROM users \
WHERE userid = '%u'
# For deliver:
user_query = SELECT home, uid, gid FROM users WHERE userid = '%u'
---%<-------------------------------------------------------------------------
LDAP example
------------
'dovecot.conf':
---%<-------------------------------------------------------------------------
passdb ldap {
args = /etc/dovecot-ldap.conf
}
userdb prefetch {
}
# The userdb below is used only by deliver.
userdb ldap {
args = /etc/dovecot-ldap.conf
}
---%<-------------------------------------------------------------------------
'dovecot-ldap.conf':
---%<-------------------------------------------------------------------------
# NOTE: '\' line splitting is used only for readability, currently Dovecot
doesn't support it
pass_attrs = uid=user,userPassword=password, \
homeDirectory=userdb_home,uidNumber=userdb_uid,gidNumber=userdb_gid
# For deliver:
user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid
---%<-------------------------------------------------------------------------
(This file was created from the wiki on 2007-06-15 04:42)