1

Topic: IMAP Error | Missing +r perm | Dovecot

===System Information===
- iRedMail version: 0.9.8
- Linux Distro: Ubuntu 16.04 Xenial Xerus LTS (64x)
- Mail Account Backend: MySQL
- Web server: Apache
- Mail accounts are not managed by iRedMail Pro

===Problem===
Hey guys,
I could only find one place where the topic was discussed but was never answered. It seems like a really easy fix, but all I've done to it has not worked. Basically, the IMAP setup can't create a mailbox and it wants +r perms to the /var/run/dovecot/dict folder. I've done that plus some but it doesn't seem to work. I've also tried restarting dovecot, and the entire server machine to no avail.

===IMAP Log===
Pastebin

===Dovecot Log===
Pastebin


I've already attempted adding the necessary permissions, setting group change to it, but it hasn't done anything. Much appreciation would be had if someone can sort out what might be wrong.

Post's attachments

dovecot.log 3.59 kb, file has never been downloaded. 

imap.log 31.69 kb, 1 downloads since 2018-07-10 

You don't have the permssions to download the attachments of this post.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: IMAP Error | Missing +r perm | Dovecot

Jul 10 03:12:42 pldyn dovecot: imap(postmaster@xxx): Error: chdir(/home/pldyn_network/mailsys/vmail/vmail1/mail.pldyn.net/p/o/s/postmaster//) failed: Permission denied (euid=2000(<unknown>) egid=2000(<unknown>) missing +x perm: /home/pldyn_network/mailsys/vmail/vmail1, dir owned by 5000:5000 mode=0700)

Is uid 2000 and gid 2000 assigned to system user "vmail"?

3

Re: IMAP Error | Missing +r perm | Dovecot

ZhangHuangbin wrote:

Jul 10 03:12:42 pldyn dovecot: imap(postmaster@xxx): Error: chdir(/home/pldyn_network/mailsys/vmail/vmail1/mail.pldyn.net/p/o/s/postmaster//) failed: Permission denied (euid=2000(<unknown>) egid=2000(<unknown>) missing +x perm: /home/pldyn_network/mailsys/vmail/vmail1, dir owned by 5000:5000 mode=0700)

Is uid 2000 and gid 2000 assigned to system user "vmail"?

UID was, but the GID wasn't, so I assigned it as such and restarted Dovecot.

Now it's giving me this error (From IMAP log):

Jul 12 12:25:27 pldyn dovecot: imap(postmaster@mail.pldyn.net): Error: stats: open(/var/run/dovecot/stats-mail) failed: Permission denied
Jul 12 12:25:27 pldyn dovecot: imap(postmaster@mail.pldyn.net): Error: read(/var/run/dovecot/dict) failed: Remote disconnected
Jul 12 12:25:27 pldyn dovecot: imap(postmaster@mail.pldyn.net): Error: read(/var/run/dovecot/dict) failed: Remote disconnected
Jul 12 12:25:27 pldyn dovecot: imap(postmaster@mail.pldyn.net): Error: Failed to autocreate mailbox Sent: Permission denied
Jul 12 12:25:27 pldyn dovecot: imap(postmaster@mail.pldyn.net): Logged out in=93 out=716

4

Re: IMAP Error | Missing +r perm | Dovecot

Show us command output please:

id vmail
doveconf -n | grep -E '(uid|gid)'

5

Re: IMAP Error | Missing +r perm | Dovecot

ZhangHuangbin wrote:

Show us command output please:

id vmail
doveconf -n | grep -E '(uid|gid)'

Here's the shell console output:
Imgur Link to Console

6

Re: IMAP Error | Missing +r perm | Dovecot

uid of vmail user is 5000, please set it to 2000 instead.

7

Re: IMAP Error | Missing +r perm | Dovecot

ZhangHuangbin wrote:

uid of vmail user is 5000, please set it to 2000 instead.

Everything is set to 2000 now.

Here's the same console report with the updated UID value.

I'll also include the IMAP log here for another connection attempt:

Jul 13 15:15:00 pldyn dovecot: imap-login: Login: user=<postmaster@mail.pldyn.net>, method=PLAIN, rip=127.0.0.1, lip=127.0.1.1, mpid=32224, TLS, session=<2n7US+Zwoqp/AAAB>
Jul 13 15:15:00 pldyn dovecot: imap(postmaster@mail.pldyn.net): Error: read(/var/run/dovecot/dict) failed: Remote disconnected
Jul 13 15:15:00 pldyn dovecot: imap(postmaster@mail.pldyn.net): Error: read(/var/run/dovecot/dict) failed: Remote disconnected
Jul 13 15:15:00 pldyn dovecot: imap(postmaster@mail.pldyn.net): Error: Failed to autocreate mailbox Sent: Permission denied
Jul 13 15:15:00 pldyn dovecot: imap(postmaster@mail.pldyn.net): Logged out in=93 out=716

8

Re: IMAP Error | Missing +r perm | Dovecot

I just found you placed the mailbox under /home/ directory. this might cause problem because /home/<user> is always set to 0700, and some services running by systemd also have "ProtectHome=yes" setting to refuse other applications write to /home/<user> directory.

Anyway, try this command first, let's see how it works:

chmod 0755 /home/pldyn_network

Also please double check all parent directories of '/home/pldyn_network/mailsys/vmail/vmail1/' is accessible by user/goup: vmail:vmail.

9

Re: IMAP Error | Missing +r perm | Dovecot

ZhangHuangbin wrote:

I just found you placed the mailbox under /home/ directory. this might cause problem because /home/<user> is always set to 0700, and some services running by systemd also have "ProtectHome=yes" setting to refuse other applications write to /home/<user> directory.

Anyway, try this command first, let's see how it works:

chmod 0755 /home/pldyn_network

Also please double check all parent directories of '/home/pldyn_network/mailsys/vmail/vmail1/' is accessible by user/goup: vmail:vmail.

By the way, this did fix it.

I forgot about this thread after having left the project alone for a while. School started, heh.

Anyways, thanks so much Zhang.