Next Previous Contents

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