I'm currently setting up an email server using postfix and courier.
postfix is configured to check the email accounts into a MySQL database. For example when I send an email to "firstname.lastname@example.org", postfix checks whether "john.doe" is in the database, and writes the mail to
/var/mail/vhosts/john.doe/. If this maildir doesn't exist, postfix creates it.
courier (the POP/IMAP server) is also configured to authenticate through MySQL. When I connect to my server and authenticate with "john.doe", courier looks into the same MySQL database and knows that the emails are located in
The problem is that courier returns an error message if the directory doesn't exist, which is what will happen for every newly created account which hasn't received an email yet. The error is simply "chdir() failed for directory /var/mail/vhosts/john.doe/".
When I want to create an email account, I have to add it to the database and create the corresponding directory. However I'd like to avoid having any access to the filesystem if possible.
Is there a way for courier to automatically create the directory, or to return "no email in the inbox" if the directory doesn't exist?