Dovecot log error

If you have such a error in /var/log/dovecot-lda :
lda(korisnik1): Error: fchown(/home/user1/mail/.imap/INBOX/dovecot.index.cache.lock, -1, 12(mail)) failed: Operation not permitted (egid=2073(user1), group based on /var/spool/mail/user1)
Or something like this in mailq :
r289QLbk027831 3111 Fri Mar 8 10:26
(Deferred: local mailer (/usr/libexec/dovecot/deliver) exited)

Solution 1
Problem is solved for this user, by creating the following folder :
With following rights :
drwxrwx— 2 user1 user1 4096 Mar 7 17:43 INBOX
Solution 2
Check account characteristics :
# id user1
uid=503(user1) gid=503(user1) groups=503(user1)
Check under which user is Sendmail working (usually it is “mail”) :
# id mail
uid=8(mail) gid=12(mail) groups=12(mail)
And to the problematic user add group “mail” :
# usermod -a -G mail user1
Check :
# id user1
uid=503(user1) gid=503(user1) groups=503(user1),12(mail)
Solution 3
After creating new account, for example user2, change rights on the following files :
-rw-rw—- 1 user2 mail 0 Mar 8 13:30 user2 – how it was
-rw——- 1 user2 mail 0 Mar 8 13:34 user2 – how it should be, version 1
-rw-rw-rw- 1 user2 mail 0 Mar 8 13:24 user2 – how it should be, version 2
Both versions will work just fine. I personally prefer the more restrictive one.
Solution 4
In my (humble) opinion, the best one, because it solves the problem for all new accounts, once and for all times.
In /etc/dovecot/dovecot.conf file add just one line :
mail_access_groups=mail – where “mail” is the user/group under which Sendmail is running
Restart Dovecot, and that is that.

Link ka objašnjenju i rešenju : link

This entry was posted in Linux and tagged , , . Bookmark the permalink.

Comments are closed.