I am trying to setup a mail server, I went over tons of tutorials on how to do this with Postfix
+ dovecot
+ MySQL
, but none was error-proof and I always got stuck at some point with an error, so I decide to configure the mail server step by step by my own, so far I have installed Postfix
and ViMbAdmin
as my postfix-admin interface, I managed to link the database with Postfix, everything is fine but one! The Postfix would not auto-create the Maildir for incoming mails.
The following is a sample mail.log
output for an incoming email:
postfix/smtpd[22086]: connect from mail-lf0-f45.google.com[209.85.215.45]
postfix/smtpd[22086]: C92B461E5B: client=mail-lf0-f45.google.com[209.85.215.45]
postfix/cleanup[22090]: C92B461E5B: message-id=<BLAH@mail.gmail.com>
postfix/qmgr[21732]: C92B461E5B: from=<BLAH-SENDER@gmail.com>, size=4535, nrcpt=1 (queue active)
postfix/virtual[22080]: C92B461E5B: to=<BLAH-RCVR@XXX.net>, orig_to=<BLAH-ALIAS@XXX.net>, relay=virtual, delay=0.13, delays=0.13/0/0/0, dsn=4.2.0, status=deferred (delivery failed to mailbox /var/mail/vhosts/XXX.net/BLAH-RCVR/mail: unable to create lock file /var/mail/vhosts/XXX.net/BLAH-RCVR/mail.lock: No such file or directory)
postfix/smtpd[22086]: disconnect from mail-lf0-f45.google.com[209.85.215.45]
If I manually create the /var/mail/vhosts/XXX.net/BLAH-RCVR/
directory, everything will go fine. I want the application auto-create the directory so I don't have to create it for every user I add to system!
What am I missing in here?
P.S: I've double checked the permission on /var/mail/vhosts/
the postfix should be able to RWX
the directory.