Re: [Dovecot] fchown failed

2009-09-14 Thread Timo Sirainen

On Sep 14, 2009, at 3:36 AM, Frank Bonnet wrote:


Sep 14 09:20:48 IMAP(xxx): Error:
fchown(/user/xxx/.imap/INBOX/dovecot.index.tmp, -1, 8(mail))  
failed:
Operation not permitted (egid=3420(math), group based on /var/mail/ 
xxx)


chmod 0600 /var/mail/*

should help. I'm trying to get distros and upstream to do that by  
default..




Re: [Dovecot] fchown() failed

2009-08-26 Thread Arthur Dent
On Mon, 2009-08-24 at 15:05 -0400, Timo Sirainen wrote:
 On Wed, 2009-08-19 at 13:18 +0100, Arthur Dent wrote:
  dovecot: Dovecot v1.2.0 starting up (core dumps disabled): 1 Time(s)
  dovecot: IMAP(mark): fchown() failed with file 
  /home/mark/Mail/.imap/INBOX/dovecot.index.log.newlock: Operation not 
  permitted: 1 Time(s)
 
 v1.2.3+ would have given a bit better error message here.

Ironically, since I posted my original message last week Fedora issued
an updated Dovecot package, so here is yesterday's message in syslog:

 **Unmatched Entries**
dovecot: Dovecot v1.2.3 starting up (core dumps disabled): 1 Time(s)
dovecot: IMAP(helena): 
fchown(/home/wife/mail/.imap/INBOX/dovecot.index.cache.lock, -1, 12(mail)) 
failed: Operation not permitted (egid=501(helena), group based on 
/var/mail/helena): 1 Time(s)
dovecot: IMAP(mark): chown(/home/mark/Mail/.imap/INBOX, -1, 12(mail)) 
failed: Operation not permitted (egid=500(mark), group based on 
/var/mail/mark): 1 Time(s)
dovecot: IMAP(mark): 
fchown(/home/mark/Mail/.imap/INBOX/dovecot.index.cache.lock, -1, 12(mail)) 
failed: Operation not permitted (egid=500(mark), group based on 
/var/mail/mark): 1 Time(s)
dovecot: IMAP(mark): 
fchown(/home/mark/Mail/.imap/INBOX/dovecot.index.log.newlock, -1, 12(mail)) 
failed: Operation not permitted (egid=500(mark), group based on 
/var/mail/mark): 1 Time(s)
dovecot: IMAP(mark): fchown(/home/mark/Mail/.imap/INBOX/dovecot.index.tmp, 
-1, 12(mail)) failed: Operation not permitted (egid=500(mark), group based on 
/var/mail/mark): 1 Time(s)
dovecot: IMAP(mark): mkdir(/home/mark/Mail/.imap/INBOX) failed: Operation 
not permitted: 1 Time(s)

 Anyway the issue is that nowadays Dovecot tries to preserve mailbox's 
 permissions
 so that shared mailboxes work properly. What permissions do you have in
 the actual INBOX file?

ls -la /var/mail/
total 202024
drwxrwxr-x.  2 root   mail  4096 2009-08-26 10:30 .
drwxr-xr-x. 15 root   root  4096 2009-08-13 12:35 ..
-rw-rw.  1 clamav mail 0 2009-08-12 12:40 clamav
-rw-rw.  1 wife   mail 190669010 2009-08-26 10:00 wife
-rw-rw.  1 mark   mail   8421931 2009-08-26 09:46 mark
-rw---.  1 root   root787636 2009-08-26 10:30 root
-rw-rw.  1 rpcmail 0 2009-08-11 16:26 rpc
-rw-rw.  1 sonmail   6750285 2009-08-26 00:39 son

 
 My guess is that you have 0660 permissions of /var/mail/$USER so Dovecot
 tries to preserve the group. Easiest fix that also makes your system
 more secure is to chmod 0600 it.

Hmmm - OK, seems you're right about that. Will changing it break
anything else? Why does group mail exist?

I will try chmod 0600 and see what happens. 

 
  As I access my mailbox several times a day (and certainly did yesterday)
  from several different mail clients I am surprised that the error count
  is only 1 for most the above entries. Is this being caused by some sort
  of cron job (logrotate perhaps)?
 
 It happens only when index files are being created/rotated, which
 happens automatically every once in a while.

Thanks very much. Your help is greatly appreciated...

Mark



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] fchown() failed

2009-08-24 Thread Timo Sirainen
On Wed, 2009-08-19 at 13:18 +0100, Arthur Dent wrote:
 dovecot: Dovecot v1.2.0 starting up (core dumps disabled): 1 Time(s)
 dovecot: IMAP(mark): fchown() failed with file 
 /home/mark/Mail/.imap/INBOX/dovecot.index.log.newlock: Operation not 
 permitted: 1 Time(s)

v1.2.3+ would have given a bit better error message here. Anyway the
issue is that nowadays Dovecot tries to preserve mailbox's permissions
so that shared mailboxes work properly. What permissions do you have in
the actual INBOX file?

My guess is that you have 0660 permissions of /var/mail/$USER so Dovecot
tries to preserve the group. Easiest fix that also makes your system
more secure is to chmod 0600 it.

 As I access my mailbox several times a day (and certainly did yesterday)
 from several different mail clients I am surprised that the error count
 is only 1 for most the above entries. Is this being caused by some sort
 of cron job (logrotate perhaps)?

It happens only when index files are being created/rotated, which
happens automatically every once in a while.


signature.asc
Description: This is a digitally signed message part