Permission denied for dovecot to access mail directory

dovecotemailpermissionspostfix

I have setup a mail server using Postfix & Dovecot on CentOS 7. When I try to fetch email using thnderbird or any other email clients, I get this error in my maillog file:

Jun 19 01:38:23 localhost dovecot: imap(default-agent@involv.ir): Error: open(/var/spool/postfix/default-agent@involv.ir) failed: Permission denied (euid=500(default-agent@involv.ir) egid=500(default-agent@involv.ir) missing +w perm: /var/spool/postfix, dir owned by 0:0 mode=0755)
Jun 19 01:38:23 localhost dovecot: imap(default-agent@involv.ir): Error: Failed to autocreate mailbox INBOX: Internal error occurred. Refer to server log for more information. [2016-06-19 01:38:23]

It seems my user default-agent@involv.ir does not have sufficient permissions to access (read/write) this directory: /var/spool/postfix/default-agent@involv.ir

How to solve this?

Best Answer

Do not use LDA from postfix, use dovecot's deliver instead. Detailed explanation can be found at http://wiki.dovecot.org/LDA/Postfix

If implemented, dovecot become the only service that have an access to the storage so there is no permission collision between postfix and dovecot.