Claudio Strizzolo
2007-Oct-16 14:41 UTC
[Dovecot] Errata: dovecot + ldap + virtual mailbox: building mail location path
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
Timo Sirainen
2007-Oct-20 23:52 UTC
[Dovecot] Errata: dovecot + ldap + virtual mailbox: building mail location path
On Tue, 2007-10-16 at 16:41 +0200, Claudio Strizzolo wrote:> mail_location = maildir:/mail/vmail/domains/%h..> mail=user,userPassword=password,mailbox=userdb_home,mail=userdb_uid,mail > =userdb_mailmail_location isn't used because you override it with mail=userdb_mail here. Relative home dirs aren't a really good idea though, there's a good chance that Dovecot logs an error about not finding the home dir. With v1.1 this could be done easily with mail=userdb_mail=maildir:/mail/vmail/domains/%$ (IIRC).> mail = Jack.London at writers.com > mailbox = writers.com/Jack.London > uid = Jack.LondonDo you really need the "mailbox" there? You could use just: mail_location = maildir:/mail/vmail/domains/%d/%n -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20071021/f8e6b062/attachment-0002.bin>