title: Can't get dovecot to run as vmail user
body: <p>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.</p>
  
  <p>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:</p>
  
  <pre><code>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(&lt;unknown&gt;) missing +r perm: /var/mail/vhosts/server.com/ldapUserHere/cur/1375390304.V901Ida20094M961759.smhraid:2,, dir owned by 1001:1001 mode=0777)
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>Thank you</p>