We use a custom program called vmail to manage delivery to virtual mailboxes. It may be invoked with vmail $DOMAIN $COMMAND, which indicates that you are configuring the virtual mailboxes for domain $DOMAIN for which you have DomTool permissions. The valid commands are:
list: Print the mapping from usernames to mailbox directories for $DOMAIN.
add $USER $MAILDIR: Add a mapping from $USER@$DOMAIN to a Maildir directory $MAILDIR. You'll be prompted to enter a password for the user, which he can then use to access IMAP, POP, or restricted SMTP services.
passwd $USER: Reset a virtual user's password.
rm $USER: Remove a mapping. The mailbox directory remains for you to deal with as you like.