Pages

Wednesday, March 13, 2013

Dovecot Error "fchown"


Sometimes we may see the below logs from mail log when we use dovecot in our mail server.

Mar 13 10:14:56 mail dovecot: POP3(abidul): fchown(/home/abidul/mail/.imap/INBOX/dovecot.index.tmp, -1, 8(mail)) failed: Operation not permitted (egid=1079(abidul), group based on /var/mail/abidul)

Mar 13 10:14:56 mail dovecot: POP3(sumanta): fchown(/home/sumanta/mail/.imap/INBOX/dovecot.index.log.newlock, -1, 8(mail)) failed: Operation not permitted (egid=1092(sumanta), group based on /var/mail/sumanta)

Mar 13 10:14:40 mail dovecot: POP3(shehab): fchown(/home/shehab/mail/.imap/INBOX/dovecot.index.cache.lock, -1, 8(mail)) failed: Operation not permitted (egid=1048(shehab), group based on /var/mail/shehab)

Dovecot tried to copy /var/mail/user files group (mail) to the index file directory it was creating (/home/user/mail/.imap/INBOX) but the process didn’t belong to the mail group. As a result the error shows.

To solve the problem just run following command.

#chmod 0600 /var/mail/*

You can also check the mail location and mail group settings from /etc/dovecot/dovecot.conf

mail_location = mbox:~/mail:INBOX=/var/mail/%u

mail_privileged_group = mail

Now check mail log and see the error vanished. 

1 comment: