4
Usually your LDAP database contains also the <userdb information>
5
[UserDatabase.txt]. If your home directory can be specified with a template and
6
you're using only a single<UID and GID> [UserIds.txt], you should use <static
7
userdb> [UserDatabase.Static.txt] instead to avoid an unnecessary LDAP lookup.
8
You can also use<prefetch userdb> [UserDatabase.Prefetch.txt] to avoid the
11
Userdb lookups are always done using the default DN ('dn' setting) bind. It's
12
not possible to do the lookup using the user's DN (remember that e.g.<deliver>
13
[LDA.txt] needs to do userdb lookups without knowing the user's password).
15
The userdb lookups are configured in very much the same way as <LDAP password
16
lookups> [AuthDatabase.LDAP.PasswordLookups.txt]. Instead of 'pass_attrs' and
17
'pass_filter', the userdb uses 'user_attrs' and 'user_filter'. Typically
18
'pass_filter' and 'user_filter' are equivalent.
20
If you're using a single UID and GID for all the users, you can specify them
21
globally instead of returning them from LDAP:
23
* v1.0: 'user_global_uid' and 'user_global_gid' settings in
25
* v1.1+: 'mail_uid' and 'mail_gid' settings in 'dovecot.conf'
29
---%<-------------------------------------------------------------------------
30
user_attrs = homeDirectory=home, uidNumber=uid, gidNumber=gid
31
user_filter = (&(objectClass=posixAccount)(uid=%u))
32
---%<-------------------------------------------------------------------------
34
Attribute templates (v1.1+)
35
---------------------------
37
You can mix static text with the value returned from LDAP by using %$ in the
40
Create a "quota_rule" field with value "*:bytes=<n>" where <n> comes from
41
"quotaBytes" LDAP attribute:
43
---%<-------------------------------------------------------------------------
44
user_attrs = quotaBytes=quota_rule=*:bytes=%$
45
---%<-------------------------------------------------------------------------
47
Create a "mail" field with value "maildir:/var/mail/<dir>" where <dir> comes
48
from "sAMAccountName" LDAP attribute:
50
---%<-------------------------------------------------------------------------
51
user_attrs = sAMAccountName=mail=maildir:/var/spool/vmail/%$
52
---%<-------------------------------------------------------------------------
54
You can add static fields that aren't looked up from LDAP (v1.1.rc5+). For
55
example create a "mail" field with value "/var/vmail/%d/%n":
57
---%<-------------------------------------------------------------------------
59
quotaBytes=quota_rule=*:bytes=%$, \
60
=mail=/var/vmail/%d/%n
61
---%<-------------------------------------------------------------------------
63
(This file was created from the wiki on 2009-07-10 04:42)