I have postfix setup and running. Everything seems good other than the directory permission errors. In the past i accidentally ran chown -R apache / which as you can imagine broke a crazy amount of stuff. Im trying to send an email to a user account called dan. All mail is setup to go to home/user/Maildir

This is the error i get in the log

Jun 10 23:28:51 vps12345 postfix/local[27188]: 4BA06700701: to=dan@domain.com, relay=local, delay=0.12, delays=0.09/0.01/0/0.02, dsn=5.2.0, status=bounced (maildir delivery failed: create maildir file /home/dan/Maildir/tmp/1433971731.P27188.vps12345.ovh.net: Permission denied)

I have made sure the directories all exist and i have given them all permission of 777, but no joy. I suspect the ownership might be the issue since root owns everything.

My main issue is i dont know what directories i need to set the permissions correctly for in order to be able to make this work.

In case its needed here is my postfix config

myhostname = mail.domain.com
mydomain = domain.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain
mynetworks =, ipv4, ipv6
relay_domains =
home_mailbox = Maildir/

Im running centos 6.

  • 2
    /home/AAA directory should be owned by the user AAA instead of root – masegaloeh Jun 10 '15 at 21:46

The MailDir tree should be owned by the user that is getting the message delivered.

You can fix the home directories with this little script.

cd /home
for dir in *; do
    [ -d $dir ] && chown -R $dir $dir

This will reset each users home directory tree to be owned by that user. In the rare case that the home directory name does not match the userid this will fail.

Postfix will also need access to its spool directories.

  • aweseome! this worked perfectly. mail is getting sent to the maildir directory now. – Dan Hastings Jun 11 '15 at 6:22

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.