Question

I am attempting to set up a postfix/dovecot environment using virtual users with a maildir structure. I have set up a directory for the virtual maildirs and Postfix works with it fine as user 'vmail'. User authentication happens via LDAP connections to an Active Directory server.

I have Dovecot authenticating via LDAP and things seem to be running smooth, but I can't get it to access the maildirs as the 'vmail' user. Instead, it wants to access as the authenticated LDAP user. For example:

Aug  1 15:52:08 servername dovecot: imap(ldapUserHere): Error: open(/var/mail/vhosts/server.com/ldapUserHere/cur/1375390304.V901Ida20094M961759.servername:2,) failed: Permission denied (euid=10093(ldapUserHere) egid=10002(<unknown>) missing +r perm: /var/mail/vhosts/server.com/ldapUserHere/cur/1375390304.V901Ida20094M961759.smhraid:2,, dir owned by 1001:1001 mode=0777)

In the above, all instances of "ldapUserHere" are the user I logged in with via imap (which authenticated via LDAP). I have attempted to force Dovecot to use the 'vmail' user and group (uid and gid are both 1001), but it ignores the directives for this in the conf.

The only explanation I have found that is remotely close is in the dovecot wiki stating that a UID and GID retrieved via LDAP will override the mail_gid and mail_uid settings in dovecot.conf.

Is there a way to force it to use the 'vmail' user no matter what, or a way to keep the gid/uid from being retrieved during the LDAP connection?

Thank you

Was it helpful?

Solution

Finally found the solution,

Running 'dovecot -n' gives the configuration that dovecot will be running with after all the config files are combined. I had all my configuration options for passdb and userdb in my dovecot.conf, but I didn't realize these options were also defined in files in the /etc/dovecot/conf.d directory. Upon investigation I found a conflicting userdb directive, and upon removal things became sane.

Hope this helps someone in the future.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top