Thank you - I was thinking perhaps a wrapper script would be necessary.

How do the multiple userdb/passdb sections work? Once a match is found, does processing stop? Or are multiple matches combined? Does the "userdb static" set defaults which could be used for the userdb ldap?

François Wautier wrote:
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
}


--
Daniel
A spam trap for your crawler pleasure: [EMAIL PROTECTED]

Reply via email to