SOLVING THE PROBLEM WITH VIRTUALDOMAINS - THE ALIAS WAY
=======================================================
1. Domain handling
Put the all the domains in /var/qmail/control/rcpthosts like this:
foobar.net
foo.net
and in /var/qmail/control/virtualdomains put this:
foobar.net:alias-foobar
foo.com:alias-foo
DO NOT put the domains in locals if you have them in virtualdomains!
2. Create aliases
Now all mail to foobar.net is handled by ~alias/.qmail-foobar-*
which means that you can create a ~alias/.qmail-foobar-joe and put
&
joeh@popserver.net
in this file. And with this in mind it is easy to understand that
foo.com is handled by ~alias/.qmail-foo-* and you can now construct
a file ~alias/.qmail-foo-joe where you put
&
joeb@popserver.net
(in this case popserver.net could be handled by the same machine - e.g.
in locals and the users joeb and joeh can be regular users of the
machine)
3. Finally
give qmail-send a kill -HUP
SOLVING THE PROBLEM WITH VIRTUALDOMAINS - THE ONE DOMAIN PER USER WAY
=====================================================================
This is very similar to the previous solution, but is a common one for
servers where domain-owner-users reside.
1. Domain handling
Put the all the domains in /var/qmail/control/rcpthosts like this:
foobar.net
foo.net
and in /var/qmail/control/virtualdomains put this:
foobar.net:joeh
foo.com:joeb
DO NOT put the domains in locals if you have them in virtualdomains!
2. Create aliases
Now all mail to foobar.net is handled by ~joeh/.qmail-*
which means that you can create a ~joeh/.qmail-joe and put
./Maildir/
or whatever delivery joeh wants. And as with all other examples it
follows that foo.com is handled by ~joeb/.qmail-* and you can construct
a file ~joeb/.qmail-joe where you put
./Mailbox
or whatever delivery joeb is pleased with.
3. Finally
give qmail-send a kill -HUP
[NOTE: Worthwhile to know is that if the localhost is named
popserver.net then
joeb-joe@popserver.net is ALSO delivered to
~joeb/.qmail-joe]
SOLVING THE PROBLEM WITH LOCALS
===============================
0. Install the fastforward package
<
http://www.qmail.org/koobera/www/fastforward.html>
1. Domain handling
put the all the domains in /var/qmail/control/rcpthosts like this:
foobar.net
foo.com
and in /var/qmail/control/locals put this:
foobar.net
foo.com
DO NOT put the domains in virtualdomains if you have them in locals!
2. Create aliases
Now all mail is handled by local users and finally by the user "alias".
And all aliases that are not explicitily "~alias/.qmail-*" is
delivered to fastforward through ~alias/.qmail-default.
Therefore:
put this in /etc/aliases
joe@foo.com:joeh
joe@foobar.net:joeb
3. Finally
give qmail-send a kill -HUP and run /var/qmail/bin/newaliases
(See further the documentation for fastforward)
[
NOTE that both users still have these addresses, as the mail for the
domains is handled locally:
joeh:
joeh@foo.com AND
joeh@foobar.net
joeb:
joeb@foo.com AND
joeb@foobar.net
]