Dovecot doesn't have write permissions?

None of my email is being accepted, and I keep getting this error in my /var/log/mail.log:

Feb 10 09:58:35 earth dovecot: lmtp(8060, dylan@clickclickboommobile.com): Error: user dylan@clickclickboommobile.com: Initialization failed: Initializing mail storage from mail_location setting failed: mkdir(/var/mail/vhosts/clickclickboommobile.com/dylan) failed: Permission denied (euid=1001(<unknown>) egid=1001(<unknown>) missing +w perm: /var/mail/vhosts/clickclickboommobile.com, dir owned by 5000:5000 mode=0755)</unknown></unknown>

I was trying to follow the linode tutorial at ~~[https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql#sphpostfix" target="blank">](https://library.linode.com/email/postfi … ph_postfix">https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql#sph_postfix](.

This is the mailprivilegedgroup line in my /etc/dovecot/conf.d/10-mail.conf

mail_privileged_group = vmail

And these are the permissions on /var/mail

drwxrwsr-x 3 vmail vmail 4096 Feb  9 01:04 /var/mail

Has anyone seen this before? Does anyone know what's wrong? I can't figure it out.

5 Replies

I tried changing the line in dovecot to this:

mail_privileged_group = mail

then restarting postfix and dovecot. No change.

Do you have a user called vmail and does it have a directory /home/vmail? I had to have that.

I don't, but I tried chmod 777 /var/mail and there was still no change.

I then went through and applied chmod 777 to every subdirectory manually, like this:

chmod 777 /var/mail
chmod 777 /var/mail/vhosts
chmod 777 /var/mail/vhosts/DOMAIN.com
chmod 777 /var/mail/vhosts/DOMAIN.com/USER1
chmod 777 /var/mail/vhosts/DOMAIN.com/USER2
chmod 777 /var/mail/vhosts/DOMAIN.com/USER3

And this worked! Why would that be? Shouldn't the permissions from /var/mail cascade down to all the subdirectories? Isn't that what the 's' in the permissions flags means?

I'm using MySQL for user auth and virtual domains so I don't want to tell you wrong. Perhaps someone on here who has a similar configuration to yours can advise further.

It looks like the problem was that all the subdirectories somehow had different permissions than /var/mail despite the s flag in the /var/mail permissions. I was able to fix the problem by going through and setting all their permissions manually.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct