This document is written for Postfix 2.0 and higher.
This document describes how to setup Virtual Domains (Aliases and Mailboxes) with Postfix, Courier-IMAP (or dovecot imap) and MySQL. I have found that this is the easiest combination that allows you to serve Virtual Domains, and Users. With this it’s also very easy to implement webmail systems like SquirrelMail.
NOTE: One thing that you have to keep in mind is that Courier-IMAP only supports the Maildir format.
About the used software:
Postfix attempts to be fast, easy to administer, and secure, while at the same time being sendmail compatible enough to not upset existing users. Thus, the outside has a sendmail-ish flavor, but the inside is completely different.
Courier-IMAP is a server that provides IMAP access to Maildirs. This IMAP server does NOT handle traditional mailbox files (/var/spool/mail, and derivatives), it was written for the specific purpose of providing IMAP access to Maildirs.
The MySQL database server is the world’s most popular open source database. Its architecture makes it extremely fast and easy to customize. Extensive reuse of code within the software and a minimalistic approach to producing functionally-rich features has resulted in a database management system unmatched in speed, compactness, stability and ease of deployment. The unique separation of the core server from the table handler makes it possible to run with strict transaction control or with ultra-fast transactionless disk access, whichever is most appropriate for the situation.
SASL is the Simple Authentication and Security Layer, a method for adding authentication support to connection-based protocols. To use SASL, a protocol includes a command for identifying and authenticating a user to a server and for optionally negotiating protection of subsequent protocol interactions. If its use is negotiated, a security layer is inserted between the protocol and the connection.
Postfix VDA enables quota support for Postfix.
Dovecot  Is an alternative IMAP server, known to perform a lot better than courier, especially with clients like thunderbird and mail.app. It is also slightly easier to configure, and works well with the virtual users setup.
If you are planning to use this howto as a basis for Postfix Admin, please be aware that there is some differences in the tables.