Bryan Wright
2007-Jul-05 14:13 UTC
[Dovecot] Permission errors when creating/reading files in users' mail directories
Hi folks,
I'm trying to migrate an old uw-imap server to dovecot,
and running into puzzling (to me) permission problems. I've
configured mail_location as follows:
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u
and each user's mail directory has permissions like this:
drwx------ 2 uid gid 4096 Jul 5 09:26 /home/uid/mail
But when I try to check a user's mail using an imap
client, I see the following error:
Jul 5 09:59:49 imap dovecot: IMAP(uid): mkdir_parents(/home/uid/mail/.imap/
INBOX) failed: Permission denied
If I open up the permissions so anyone can write, I find
that the .imap directory is successfully created, and owned
by "uid". Is dovecot initially creating the directory with
some other ownership, and then changing the ownership to "uid"?
I can get around this problem by setting INDEX in
mail_location, and pointing it to a directory with more
open permissions, but then I run into the next problem:
Jul 5 09:25:49 imap dovecot: IMAP(uid): open() failed with mbox file
/var/spool/mail/uid: Permission denied
In this case, the permissions are set as follows:
-rw------- 1 bkw1a mail 1267 Jul 5 08:47 /var/spool/mail/uid
How should the permissions be set on the spool files?
Thanks in advance,
Bryan
--
=======================================================================Bryan
Wright |"If you take cranberries and stew them like
Physics Department | applesauce, they taste much more like prunes
University of Virginia | than rhubarb does." -- Groucho
Charlottesville, VA 22901|
(434) 924-7218 | bryan at virginia.edu
========================================================================
Timo Sirainen
2007-Jul-05 14:50 UTC
[Dovecot] Permission errors when creating/reading files in users' mail directories
On Thu, 2007-07-05 at 14:13 +0000, Bryan Wright wrote:> and each user's mail directory has permissions like this: > > drwx------ 2 uid gid 4096 Jul 5 09:26 /home/uid/mail > > But when I try to check a user's mail using an imap > client, I see the following error: > > Jul 5 09:59:49 imap dovecot: IMAP(uid): mkdir_parents(/home/uid/mail/.imap/ > INBOX) failed: Permission denied..> Jul 5 09:25:49 imap dovecot: IMAP(uid): open() failed with mbox file > /var/spool/mail/uid: Permission deniedSounds like your userdb is returning wrong uid. Set mail_debug=yes to see what Dovecot is really using. -------------- 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/20070705/70e6045f/attachment-0002.bin>
Bryan K. Wright
2007-Jul-05 15:25 UTC
[Dovecot] Permission errors when creating/reading files in users' mail directories
tss at iki.fi said:>> Jul 5 09:25:49 imap dovecot: IMAP(uid): open() failed with mbox file >> /var/spool/mail/uid: Permission denied > Sounds like your userdb is returning wrong uid. Set mail_debug=yes to see what > Dovecot is really using.Excellent! After looking at the uids, I found that my test user had both an entry in our ldap database and the local /etc/passwd file. Removing the spurious /etc/passwd entry (and fixing the local file ownerships) gets rid of the permission problems. Thanks for your help. Bryan -- =======================================================================Bryan Wright |"If you take cranberries and stew them like Physics Department | applesauce, they taste much more like prunes University of Virginia | than rhubarb does." -- Groucho Charlottesville, VA 22901| (434) 924-7218 | bryan at virginia.edu ========================================================================