1. Add domain to /var/qmail/control/rcpthosts
2. Add domain:user-domainhandle to /var/qmail/control/virtualdomains, e.g.
"exampledomain.org:johndoe-example"
3. "su -" to the admin user for that domain, in this case "johndoe"
4. Create a ".qmail-default" file pointing to the default recepiant (see below)
5. Create a ".qmail-domainhandle-recepiant" file for each recepiant:
* ".qmail-example-johndoe" will control mail for "johndoe@exampledomain.org"
* ".qmail-example-janedoe" will control mail for "janedoe@exampledomain.org"
* ".qmail-example-john:doe" will control mail for "john.doe@exampledomain.org"
* ".qmail-example-default" will control all other mail for exampledomain.org.
Each file may contain one or more recepients for each .qmail file:
* "&john" will cause delivery to a local user called "john"
* "john" will cause delivery to a local user called "john" (i.e the leading ampersand is optional)
* "john@otherdomain.org" will cause delivery to a remote mail exchange
* "| /full/path/to/program" will cause execution of that program, which will receive the full email through STDIN
* "# comment" is a comment (no duh! ;-)
* "/full/path/to/Maildir/" will cause delivery to a locally stored mail DIRECTORY (The trailing slash is important)
* "/full/path/to/Mailbox" will cause delivery to a locally stored mailbox
Finally, reload qmail to activate changes:
/etc/rc.d/init.d/qmail reload
For more information about how to write proper .qmail files: "man dot-qmail"