3

I can't figure out what I am missing. I'm setting up a new mail server and had this erorre every time I receive an email.
The user is inside the group mail

mail:x:8:dovecot,user.name

The perms directory are here /var/mail

drwxrwsr-x  3 root mail   4096 nov 11 12:20 mail/

This is dovecot configuration

# 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.13 (7b14904)
# OS: Linux 4.4.0-47-generic x86_64 Ubuntu 16.04.1 LTS ext4
auth_mechanisms = plain login
mail_location = mbox:/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"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
ssl = no
userdb {
  driver = passwd
}
8

Do you read this documentation?

You must add

mail_privileged_group = mail

Or make /var/mail world-writable with sticky bit set, allowing anyone to create new files but not overwrite or delete existing files owned by someone else

chmod a+rwxt /var/mail

  • I did try the sticky bit but didn't work. Tryed with mail_privileged_group but same error after restarting dovecot. The only solution by now is to create the directory in /var/Mail by hand and give the user's owner. What a about a good solution? – Kreker Nov 11 '16 at 12:56
  • @Kreker "I did try the sticky bit but didn't work" I'm not entirely sure I believe that. Did you follow all the instructions with respect to the sticky bit (ie, world-writeable also)? – MadHatter supports Monica Nov 11 '16 at 12:58
  • Yes of course. If you are using mail_privileged_group = mail all mail users must be in specified group. – Slipeer Nov 11 '16 at 12:59
  • ok this is working,after adding the new user to user mail. for some reason I have to reset the sticky bit. Sorry – Kreker Nov 11 '16 at 13:48
2

In my own situation I've found that simply making sure that /var/mail is owned by the mail group and making sure that the user's group is set to mail as well is enough for this to work.

If you're sharing dovecot's authentication system with other services (IE: you're using /etc/passwd & /etc/shadow for user information and authentication instead of /etc/mail/passwd or some such), you'll want to at least make sure that the user has mail as one of its groups, even if it's not practical to make mail its primary group. In a shared authentication system scenario, you'll also want to have the mentioned mail_privileged_group parameter set to mail in dovecot.conf, or in one of its included configuration files like so:

mail_privileged_group = mail

I should also note that 0770 should be the highest privileges you need to give to /var/mail. dovecot will create the user's directory with user only write permissions after its created, so you don't have to worry about the group permissions getting inherited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.