I have set up a directory (/var/local/virtualdir/) as the maildir with a special user/group (virtualmail) and in it I create directories for each domain (example1.tld, example2.tld etc) and sub dir's for each mailbox). Only at the moment, apart from the first one, they are all created as with user root as the owner. How important is to have all the directory tree owned by the same user group (virtualmail:virtualmail) ?
> How important is to have all the directory tree owned by the same user > group (virtualmail:virtualmail) ?My understanding (which could be wrong) is that it's pretty important. First, as a rule of thumb, nothing should be owned by root that doesn't have to be owned by root. When Dovecot is writing mail to a directory, it assumes the user ID of the recipient. In your virtual setup you probably don't have local users, so Dovecot will change to the user id returned from your database/ldap query, or, if using LDAP and you want to, to the user specified in user_global_uid setting. In either case, that user should be the user who owns the directory tree (virtualmail) and not root. Your setup can work, of course, if you give the directory read/write permissions for group and world, but why would you want to? - Pete
That last line actually made it possible for me to be able to log into the server :) I am still getting errors from PAM but it starting to look good. Is there a good HowTo on setting Dovecot to comunicate directly to MySql without using PAM in the middle ? Also, Since Postfix is still not working on my server, I can't actually recive Emails. Is there somewere an example of the files that need to be in the maildir that I can put them in there and test that the email client get's the mail out ? On Wed, 29 Dec 2004 18:36:34 +0200, Timo Sirainen <tss at iki.fi> wrote:> > If you have passwords in Mysql, you probably don't want to use > passwd-file as your auth_userdb. Rather just use: > > auth_userdb = static uid=100 gid=101 home=/var/local/virtualdir/%d/%u >