Virtual hosts are specified in the virtualdomains file, usually found in /var/qmail/control. This file has the format:
full_virtual_host_address:local_user
flintstone.stoneage.com:flintstone
Now, all mail sent to user@flintstone.stoneage.com gets remapped to
flintstone-user@bedrock.stoneage.com . For example, if mail gets sent
to:
pebbles@flintstone.stoneage.commail gets delivered to:
flintstone-pebbles@bedrock.stoneage.comSince the user flintstone on bedrock.stoneage.com controls all mail to flintstone-anything, this user effectively controls all email addresses in the flintstone.bedrock.com domain.
For example, mail to:
pebbles@flintstone.stoneage.comwould be controlled by ~flintstone/.qmail-pebbles.
Again, you have a machine called bedrock.stoneage.com, and you want to want to handle mail for the virtual domain flintstone.stoneage.com. You decide to let the alias user handle the mail. In the virtualdomains file on bedrock.stoneage.com put:
flintstone.stoneage.com:alias-flintstoneNow, all mail sent to user@flintstone.stoneage.com gets remapped to alias-flintstone-user@bedrock.stoneage.com. This means that all mail to the flintstone.stoneage.com domain is controlled by the ~alias/.qmail-flintstone-* files on bedrock.stoneage.com.
For example, mail to:
pebbles@flintstone.stoneage.comwould be controlled by ~alias/.qmail-flintstone-pebbles.
The MX record for flintstone.stoneage.com should point to bedrock.stoneage.com.
See the dot-qmail man page for information on creating .qmail files.