[Dovecot] Errata: dovecot + ldap + virtual mailbox: building mail location path

Claudio Strizzolo Claudio.Strizzolo at ts.infn.it
Tue Oct 16 17:41:46 EEST 2007


Hi all again,
I've just realized that I did a bad cut&paste in my previous mail, then 
I rewrite my request. I apologize.


I am trying to set up my dovecot configuration using LDAP and virtual
mailboxes. I succeeded in authenticating the users correctly with LDAP,
but have problems with referencing the correct mail location directory.
I manage several domains. The mailboxes are stored under separate
directories for each domain:

/mail/vmail/domains/writers.com/William.Shakespeare/
/mail/vmail/domains/writers.com/Jack.London/

/mail/vmail/domains/painters.com/Pablo.Picasso/
/mail/vmail/domains/painters.com/Vincent.VanGogh/

Now, I supposed I could build the path by setting the common part of the
paths as mail_location into dovecot.conf:

mail_location = maildir:/mail/vmail/domains/%h
passdb ldap {
   args = /etc/dovecot-ldap.conf
}
userdb ldap {
  args = /etc/dovecot-ldap.conf
}
userdb prefetch {
}

and getting the variable part ("domain/user", i.e.
writers.com/Jack.London) from the userdb in dovecot-ldap.conf:

auth_bind = yes
auth_bind_userdn = mail=%u,vd=%d,o=hosting,dc=example,dc=com
ldap_version = 3
base = o=hosting,dc=example,dc=com
deref = never
scope = subtree
user_attrs = mail,,mailbox,mail,,
user_filter =
(&(objectClass=VirtualMailAccount)(accountActive=TRUE)(mail=%u))
pass_attrs =
mail=user,userPassword=password,mailbox=userdb_home,mail=userdb_uid,mail
=userdb_mail
pass_filter =
(&(objectClass=VirtualMailAccount)(accountActive=TRUE)(mail=%u))
default_pass_scheme = CRYPT

In the LDAP database the fields are something like:

mail = Jack.London at writers.com
mailbox = writers.com/Jack.London
uid = Jack.London

However, the above does not work. Here is an extract from the log:

Oct 16 15:57:07 mymail.example.com dovecot: auth(default):
ldap(Jack.London at writers.com,::ffff:127.0.0.1): user search:
base=o=hosting,dc=example,dc=com scope=subtree
filter=(&(objectClass=VirtualMailAccount)(accountActive=TRUE)(mail=Jack.London at writers.com)) 

fields=mail,mailbox,mail
Oct 16 15:57:07 mymail.example.com dovecot:
IMAP(Jack.London at writers.com): Ambiguous mail location setting, don't
know what to do with it: writers.com/Jack.London/ (try prefixing it with
mbox: or maildir:)
Oct 16 15:57:07 mymail.example.com dovecot:
IMAP(Jack.London at writers.com): Failed to create storage with data:
writers.com/Jack.London

Any hints?
BTW, I am trying to prefetch, as you see, but I am not sure that works too.
Thanks in advance

Claudio


More information about the dovecot mailing list