I am trying to setup a mail server, I went over tons of tutorials on how to do this with
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
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: connect from mail-lf0-f45.google.com[220.127.116.11] postfix/smtpd: C92B461E5B: client=mail-lf0-f45.google.com[18.104.22.168] postfix/cleanup: C92B461E5B: message-id=<BLAH@mail.gmail.com> postfix/qmgr: C92B461E5B: from=<BLAH-SENDER@gmail.com>, size=4535, nrcpt=1 (queue active) postfix/virtual: 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: disconnect from mail-lf0-f45.google.com[22.214.171.124]
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.