3

I'm trying to create my first mail server with postfix, Dovecot and squirrel mail on Ubuntu 14.04

To get started did i follow this tutorial on this page. http://www.tecmint.com/setup-postfix-mail-server-in-ubuntu-debian/

I created a user on my linux server called nicolai with a random password that im using to sign in to squirrelmail.

But i keep getting this error:

ERROR: Could not complete request.
Query: SELECT "INBOX"
Reason Given: [SERVERBUG] Internal error occurred. Refer to server log for more information. [2015-08-11 17:31:42]

And my log file give me this error:

Aug 11 17:31:44 remedy dovecot: imap(nicolai): Error: open(/var/mail/nicolai) failed: Permission denied (euid=1001(nicolai) egid=1002(nicolai) missing +w perm: $var/mail, we're not in group 8(mail), dir owned by 0:8 mode=0775)
Aug 11 17:31:44 remedy dovecot: imap(nicolai): Error: Failed to autocreate mailbox INBOX: Internal error occurred. Refer to server log for more information. [2015-08-15-08-11 17:31:44]

So for some reason it seems like it won't create the INBOX - I checked the mail directory in my home folder and it has only created the following folders INBOX.Drafts, INBOX.Sent and INBOX.Trash

I have not been able to find a solution on the internet so I'm hoping someone else have tried the same as me before.

niiicolai
  • 39
  • 1
  • 1
  • 3

3 Answers3

9

The first line of the dovecot error indicates it doesn't have permission write to /var/mail/. This indicates the dovecot is running under an account without permission to write to the folder. /var/mail/ is owned by root:mail (UID/GID 0:8), giving full read/write/execute permissions to both root and the group mail. Dovecot is running under nicolai to access it, and because nicolai is not in the group mail, the folder cannot be accessed.

I'm not sure how the other inbox folders got created, but to fix this, all you should need to do is add nicolai to mail, like this:

adduser nicolai mail

That should allow nicolai to access it's mail folder, and fix the problem.

ConnorJC
  • 959
-1

you can add nicolai to the mail group, it worked for me

usermod -a -G mail nicolai
-2

The issue could be that SELinux is blocking access for the user mentioned in your log file. If this is the case disabling SELinux enforcement should allow you to work around this. This can be done by issuing the command below:

$ setenforce 0

Be aware that SELinux is a security feature and you might want consider whether you want to disable it entirely or not.

pacey
  • 3,853
JackyChan
  • 101
  • 1