I'm a bit unclear on these - give me a moment to ramble on. I should mention I'm using version 1.0.3, my primary backend is LDAP, and I do NOT want to store user mail folders in my LDAP directory. I currently have the following: default_mail_env = maildir:/var/mail/%d/%n passdb ldap { args = /etc/dovecot/dovecot-ldap.conf } # Instructions for deliver state a userdb is still required if using prefetch userdb ldap { args = /etc/dovecot/dovecot-ldap.conf } userdb prefetch { } My dovecot-ldap.conf is pretty simple - the trimmed version is: hosts = localhost auth_bind = no user_attrs = %d/%n=mail user_filter = (mail=%u) pass_attrs = (&(userPassword=password)(mail=%u)) user_global_uid = 5000 user_global_gid = 8 I recognize that the pass_attrs is incorrect for a prefetch config - but I couldn't get it to work. My mail folder structure is /var/mail/domain/username. If, under 1.0.3, I can't use the %d/%n variables to build the user/home/mail parameters in the LDAP config, can I do it in the configuration stanza? Something like: passdb ldap{ args = home=%dn/%n mail=%d/%n /etc/dovecot/dovecot.conf } -- Daniel
Hi, I was face with a similar problem a couple of month ago. If I recall correctly, the system needed the "home" variable but it was empty because it could not be retrieved in the Actuve Directory tree. Here is what I did (adapted to your setup..... I think) In my ldap setup I set pass_attrs = mail=userdb_home In the main conf file I did mail_executable = /usr/libexec/dovecot/special.sh And in "special.sh" I put #!/bin/sh myuser=`echo $HOME|sed s/@.*$//` domain=`echo $HOME|sed s/^.*@//` export USER=$HOME export HOME=/var/mail/${domain}/${myuser} export MAIL="maildir:${HOME}" exec /usr/libexec/dovecot/imap Voila! Make sure that special.sh is where "mail_executable" says it is.... And don't forget to chmod a+x it. Hope this helps Fran?ois On Thursday 06 September 2007 06:20, Daniel L. Miller wrote:> I'm a bit unclear on these - give me a moment to ramble on. I should > mention I'm using version 1.0.3, my primary backend is LDAP, and I do > NOT want to store user mail folders in my LDAP directory. > > I currently have the following: > > default_mail_env = maildir:/var/mail/%d/%n > passdb ldap { > args = /etc/dovecot/dovecot-ldap.conf > } > # Instructions for deliver state a userdb is still required if using > prefetch > userdb ldap { > args = /etc/dovecot/dovecot-ldap.conf > } > userdb prefetch { > } > > My dovecot-ldap.conf is pretty simple - the trimmed version is: > hosts = localhost > auth_bind = no > user_attrs = %d/%n=mail > user_filter = (mail=%u) > pass_attrs = (&(userPassword=password)(mail=%u)) > user_global_uid = 5000 > user_global_gid = 8 > > I recognize that the pass_attrs is incorrect for a prefetch config - but > I couldn't get it to work. My mail folder structure is > /var/mail/domain/username. > > If, under 1.0.3, I can't use the %d/%n variables to build the > user/home/mail parameters in the LDAP config, can I do it in the > configuration stanza? Something like: > > passdb ldap{ > args = home=%dn/%n mail=%d/%n /etc/dovecot/dovecot.conf > }
On Wed, 2007-09-05 at 16:20 -0700, Daniel L. Miller wrote:> I'm a bit unclear on these - give me a moment to ramble on. I should > mention I'm using version 1.0.3, my primary backend is LDAP, and I do > NOT want to store user mail folders in my LDAP directory. > > I currently have the following: > > default_mail_env = maildir:/var/mail/%d/%nmail_location is used nowadays.> user_attrs = %d/%n=mailYou don't have to set mail separately, it's enough to set it once in mail_location.> pass_attrs = (&(userPassword=password)(mail=%u))That looks like it should be in pass_filter, not pass_attrs.> user_global_uid = 5000 > user_global_gid = 8 > > I recognize that the pass_attrs is incorrect for a prefetch config - but > I couldn't get it to work. My mail folder structure is > /var/mail/domain/username. > > If, under 1.0.3, I can't use the %d/%n variables to build the > user/home/mail parameters in the LDAP config, can I do it in the > configuration stanza? Something like:Use static userdb instead, since you don't need to look up anything from userdb. http://wiki.dovecot.org/UserDatabase/Static -------------- 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/20070909/827545e4/attachment-0002.bin>