Dovecot: imap Error: open (/var/mail/username) failed

Error

While configuring mail on a Ubuntu Linux server running the Postfix mail server and Dovecot IMAP server, the following errors were observed in the mail log files,

dovecot: imap(user1): Error: open(/var/mail/user1) failed: Permission denied (euid=1002(user1) egid=1002(user1) missing +w perm: /var/mail, we're not in group 8(mail), dir owned by 0:8 mode=0775)
dovecot: imap(user1): Error: Failed to autocreate mailbox INBOX: Internal error occurred.
Read more “Dovecot: imap Error: open (/var/mail/username) failed”