Having upgraded a server, many mail issues that have beaten me!     I have 8 mailboxes running under Centos, all with simple user names such as john, jr, office, junk etc.
Each is owned by a user of the same name and own password.  I made a mistake and copied a back up when server moved and somehow corrupted correct permissions.   I only use smtp (sendmail) and pop3 NOT IMAP.    Each user has same group name as user.  They have no home directory.

(I have suspicion this is to do with group/wheel but have no idea what to do!)

I have the directory structure:-

/var/mail/mailox name owner=user
/var/mail/new (Empty folder) owner= john  700
/var/mail/tmp (Empty folder) owner= john (sometimes has mail that goes nowhere - more later) 700
/var/mail/cur (Empty Folder) owner= john 700
/var/.imap 777
/var/.imap/dovecot-uidvalidity owner=junk 666   The owner seems to change!
/var/.imap/INBOX owner = junk 777
/var/.imap/INBOX/dovecot.index.log owner=jr 660  The owner seems to change
/var/.imap/INBOX/dovecot.index.cache owner=jr    the owner seems to change

Mail would not be delivered to user=john

deleted user and recreated, which seems to have worked - mail now delivered


However, maillog has weird errors - sample:-

May  4 23:11:49 server dovecot: pop3-login: Login: user=<junk>, method=PLAIN, rip=82.69.134.94, lip=185.41.9.25, mpid=21213, session=<hMBaXYjBvrBSRYZe>
May  4 23:11:49 server dovecot: pop3(junk): Error: open(/var/mail/.imap/INBOX/dovecot.index.log) failed: Permission denied (euid=1051(junk) egid=1051(junk) missing +r perm: /var/mail/.imap/INBOX/dovecot.index.log, we're not in group 500(jr))
May  4 23:11:49 server dovecot: pop3(junk): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0
May  4 23:11:50 server dovecot: pop3-login: Login: user=<jr>, method=PLAIN, rip=82.69.134.94, lip=185.41.9.25, mpid=21215, TLS, session=<xuRhXYjBv7BSRYZe>
May  4 23:11:50 server dovecot: pop3(jr): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

However, the user/group of these files keeps changing "on its own" - so dovecot is doing the changes.

*** Note even with these errors it now seems to work the mailboxes, but any help very, very gratefully received!

John Richards
Watchet
England

=====================================

Version 2.2.36

[root@server ~]# dovecot -n
# 2.2.36 (1f10bfa63) etcdovecotdovecot.conf
# OS Linux 3.10.0-1160.25.1.el7.x86_64 x86_64 CentOS Linux release 7.9.2009 (Core) ext4
# Hostname server.watchet.net
auth_mechanisms = plain login
disable_plaintext_auth = no
mail_location = mboxvarmailINBOX=varmail%u
mbox_write_locks = fcntl
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = Drafts
  }
  mailbox Junk {
    special_use = Junk
  }
  mailbox Sent {
    special_use = Sent
  }
  mailbox Sent Messages {
    special_use = Sent
  }
  mailbox Trash {
    special_use = Trash
  }
  prefix =
}
passdb {
  driver = shadow
}
protocols = pop3
service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
ssl_cert = etcletsencryptliveserver.watchet.netcert.pem
ssl_key =  # hidden, use -P to show it
userdb {
  driver = passwd
}