May I begin with saying I am very beginner with this issue, and have been searching for hours to try and fix this.

I am trying to setup a mailserver using Squirrel Mail, Docevot and Postfix.

I have gotten to the point where I can get to the squirrel mail login, but I keep getting this error...

Dec 19 16:24:59 vps647603 dovecot: imap(sales): Error: open(/var/mail/sales) failed: Permission denied (euid=1005(sales) egid=1005(sales) missing +w perm: /var/mail, we're not in group 8(mail), dir owned by 0:8 mode=0775) Dec 19 16:24:59 vps647603 dovecot: imap(sales): Error: Failed to autocreate mailbox INBOX: Internal error occurred. Refer to server log for more information. [2019-12-19 16:24:59]

The results of 'postconf -n' and 'dovecot -n' are below if this helps..

root@vps647603:~# postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no config_directory = /etc/postfix inet_interfaces = all inet_protocols = all mailbox_size_limit = 0 mydestination = mattemedia.co.uk, vps647603.ovh.net, localhost.ovh.net, localhost myhostname = vps647603.ovh.net mynetworks = [::ffff:]/104 [::1]/128 myorigin = /etc/mailname readme_directory = no recipient_delimiter = + relayhost = smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes

root@vps647603:~# dovecot -n

2.2.9: /etc/dovecot/dovecot.conf

OS: Linux 3.13.0-167-generic x86_64 Ubuntu 14.04.6 LTS

mail_location = mbox:~/mail:INBOX=/var/mail/%u 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 = pam } protocols = " imap pop3" ssl_cert =

Any help would be extremely appreciated, and may I apologise in advance for my lack of knowledge.

Many thanks

  • Running a web server is easy; running a mail server is not. If the reason of your exercise should be not to learn about how to operate such a thing and instead is to have a system ready for you in production use, then you are far better suited with a specialized setup like Mailcow (mailcow.email), which comes preconfigured with all the internal bells and whistles. Also note that Squirrel Mail is horribly outdated, and unmaintained. You should try Roundcube or Horde Webmail instead. Dec 22, 2019 at 22:43

1 Answer 1


Dovecot is lacking write permissions in directory /var/mail/sales and the error message is thus quite clear.

This command will add the user to the 'mail' group:

adduser sales mail

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .