Next Previous Contents

4. Usage

4.1 Configuration parameters

The patch you just applied adds support for three new configuration parameters you should add in the correct configuration file.

Keep in mind that MOD_MAILDIR_CREATOR is the first one to be called when no homedir exists, while POP3/IMAP MAILDIR_CREATOR are called if the maildir in the user home directory does not exist, and the script are thus usually called in the following order: If the parameters are not defined or have a null value, no maildir is created. If the maildir creator is not found no error is produced, maildirs are simply not created.

4.2 Creating the necessary script(s)...

Beware! The scripts are called with a simple execve. Thus, they cannot be ``inlined'' bash scripts. Example:

THIS IS BAD: IMAP_MAILDIR_CREATOR="mkdir $(echo 'SELECT * FROM ...'|cut -f); chmod..."

Ok, let's review a little bit the process... When a user connects, its username and password are looked up in the selected database. Once all the necessary information have been found, the daemon drops its super-user privileges to become the user it has just authenticated. It then tries to change to the user home directory and, if not found, the maildir creator script is called. Once called, it tries again to chdir to the user home directory, and if an error verifies, the user is kicked out with an error message, otherwise the home directory has been successfully created and the session goes on.

There are few things to keep in mind when writing the mailcreator script:


Next Previous Contents