|When using maildrop in a virtual mail server setup, by default it will not create new directories, which makes the task up to the administrator when adding new accounts. However, there is a very simple way to modify Maildrop so that in the event it does not find a user's mailbox directory, will automatically create Maildir style folders.
Update! You can now do this directly in maildroprc without patching the source
Before the final mail delivery in maildroprc, add the following:
`test -d $HOME/$DEFAULT`
if ( $RETURNCODE == 1 )
`mkdir -p $HOME/$DEFAULT`
`rm -rf $HOME/$DEFAULT`
The source file seems to not have changed throughout subsequent version updates, therefore this howto should apply to any new version.
Go to the maildrop source directory and then go one more level down to "maildrop." Once you are there, look for "maildir.C."
Look through the source for the "Maildir:IsMaildir" function.
In that same function you will find four if statements that check for the directory name, they will then return false. We need to change that.
chkfail == 1
Finally, add the if statement that will create the Maildirs. It goes at the very bottom of the function, right before it returns true.
if (chkfail == 1)
/* Get a valid directory string */
newdir += '';
/* Default permissions, maildrop will use this for the Maildir */
Compile and you're done!