[Dovecot] LDAP for Virtual Domains

Daniel L. Miller dmiller at amfes.com
Fri May 18 17:34:34 EEST 2007


Bryan Vyhmeister wrote:
> Is anyone using LDAP along with Dovecot where mail is being accessed 
> in the form of /var/vmail/${domain}/${user}? I have not figured out 
> how to extract the domain from LDAP in order to make this work. I know 
> this is sparse information but maybe there is an easy fix. If not, I 
> can post more information.
>
> Bryan
>
I am using almost this exact setup.  What I love about this is my LDAP 
config is minimal - no special schemas required (just core, cosine, nis, 
and inetorgperson).  Everything is driven by the "mail" field - you 
store the full mail address, with domain, and the userPassword.  I'm 
using Postfix and Dovecot.

## Dovecot.conf
...
default_mail_env = maildir:/var/mail/%d/%n
valid_chroot_dirs = /var/mail
passdb ldap {
    args = /etc/dovecot/dovecot-ldap.conf
}
userdb passwd {
    args = /etc/dovecot/dovecot-ldap.conf
}
userdb ldap {
    args = /etc/dovecot/dovecot-ldap.conf
}
...
## EOF


## Dovecot-ldap.conf
hosts = localhost
auth_bind = no
auth_bind_userdn = uid=%n, ou=People, dc=amfeslan, dc=local
ldap_version = 3
base = ou=People, dc=amfeslan, dc=local
## here's your magic lines
user_attrs = %d/%n=mail
user_filter = (mail=%u)
pass_attrs = (&userPassword=password)(mail=%u))
user_global_uid = 5000
user_global_gid = 8
## EOF


-- 
Daniel



More information about the dovecot mailing list