/var/log
directory. The errors
were occurring whenever one particular user checked her email, which was
being checked by Microsoft Outlook on her PC.# grep "Permission denied" /var/log/maillog.1 | tail -n 3 Jun 17 18:56:08 moonpoint dovecot: pop3(nell): Error: open(/home/nell/mail/.imap /INBOX/dovecot.index.log) failed: Permission denied (euid=503(nell) egid=1002(ne ll) missing +x perm: /home/nell/mail/.imap/INBOX, dir owned by 0:0 mode=0700) Jun 17 19:26:44 moonpoint dovecot: pop3(nell): Error: open(/home/nell/mail/.imap /INBOX/dovecot.index.log) failed: Permission denied (euid=503(nell) egid=1002(ne ll) missing +x perm: /home/nell/mail/.imap/INBOX, dir owned by 0:0 mode=0700) Jun 17 19:57:29 moonpoint dovecot: pop3(nell): Error: open(/home/nell/mail/.imap /INBOX/dovecot.index.log) failed: Permission denied (euid=503(nell) egid=1002(ne ll) missing +x perm: /home/nell/mail/.imap/INBOX, dir owned by 0:0 mode=0700) #
Checking the permissions and ownership on the referenced
mail/.imap/INBOX
file for her account and comparing it to other
accounts, I saw that root was listed as the owner and the group for the file
under her home directory, but for other users the same file under their home
directory was owned by the user's account and the group matched the user name
for the user.
# ls -l /home/nell/mail/.imap/INBOX/dovecot.index.log -rw-------. 1 root root 36148 Oct 8 2014 /home/nell/mail/.imap/INBOX/dovecot.index.log # ls -l /home/benny/mail/.imap/INBOX/dovecot.index.log -rw-------. 1 benny benny 22208 Jun 13 18:53 /home/benny/mail/.imap/INBOX/dovecot.index.log # ls -l /home/joe/mail/.imap/INBOX/dovecot.index.log -rw-------. 1 joe joe 40 Apr 19 2015 /home/joe/mail/.imap/INBOX/dovecot.index.log
So I changed the ownership and group of the file for her account to match what it was for others.
# chown nell /home/nell/mail/.imap/INBOX/dovecot.index.log # chgrp nell /home/nell/mail/.imap/INBOX/dovecot.index.log
I'm unsure how the ownership and group for the file may have been changed, which appears to have occurred over a year and a half ago, judging by the date on the file. I suspect I may have inadvertently made the change while troubleshooting a prior email problem with the user's account at that time.
The email server software for the system on which the files reside is
Dovecot. According to the
Dovecot wiki page
Dovecot's index files, the dovecot.index.log
file is
a transaction log file. That page also mentions that "The basic idea
behind Dovecot's index files is that it makes reading the mailboxes a lot
faster." The Dovecot index files for an account are as follows:
I checked all of the log files for the user's account and compared the owner and group for those files to the same files under others' accounts. I found that the owner and group were also set to root for the other files in her account, but the owner and group for other's files were set to their username.
# ls -lh /home/nell/mail/.imap/INBOX/ total 224K -rw-------. 1 root root 200 Oct 8 2014 dovecot.index -rw-------. 1 root root 49K Oct 8 2014 dovecot.index.cache -rw-------. 1 nell nell 36K Oct 8 2014 dovecot.index.log -rw-------. 1 root root 129K Oct 8 2014 dovecot.index.log.2 # ls -lh /home/benny/mail/.imap/INBOX/ total 68K -rw-------. 1 benny benny 7.8K Jun 2 22:15 dovecot.index -rw-------. 1 benny benny 32K Jun 13 18:53 dovecot.index.cache -rw-------. 1 benny benny 22K Jun 13 18:53 dovecot.index.log # ls -lh /home/joe/mail/.imap/INBOX/ total 12M -rw-------. 1 joe joe 2.8M Apr 19 2015 dovecot.index -rw-------. 1 joe joe 8.6M Apr 6 2015 dovecot.index.cache -rw-------. 1 joe joe 40 Apr 19 2015 dovecot.index.log -rw-------. 1 joe joe 43K Apr 19 2015 dovecot.index.log.2 #
So I set the owner and group on all of the Dovecot index files for her account to be the user identifier (UID) and GID for her account.
# chown nell /home/nell/mail/.imap/INBOX/* # chgrp !:1-2 chgrp nell /home/nell/mail/.imap/INBOX/* #