faqts : Computers : Internet : Mail Servers : qmail : Installation and Configuration

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

35 of 44 people (80%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How can I make a domain partially local?
How can I host a fraction of a domain?

Jan 31st, 2002 04:59
Eadz, Filip Salomonsson, Dave Sill, http://Web.InfoAve.Net/~dsill/lwq.html#fastforward


Say you want to accept mail locally for joe@example.com,
bill@example.com, and sue@example.com, but fred@example.com and
john@example.com should be routed to exchange.example.com.
Add the following to control/rcpthosts:
    example.com
Add the following to control/virtualdomains:
    example.com:alias-example
Create ~alias/.qmail-example-joe:
    &joe
(Likewise for bill and sue.)
Create ~alias/.qmail-example-default:
    |forward "$DEFAULT@exchange.example.com"
Finally, restart qmail to have the changes take effect.
Another way to do this is using the fastforward package. See link above.
-- update -- 
The above solution changes the email address from fred@example.com to fred@exchange.example.com, 
so is not suited to some cased where you need 2 servers accepting email from fred@example.com. 
I was given this solution on the qmail@list.cr.yp.to mailing list : 
From Adrian Ho:
You need two qmail instances, but both can be on the same server:
* Setup and install a second qmail instance (say, rooted at /var/qmail2).
   The sole responsibility of this instance is to forward the mail to the
   other server, so don't set up qmail-smtpd/pop3d/etc.  Make sure
   mydomain.com is /not/ in /var/qmail2/control/{locals,virtualdomains}.
* echo 'mydomain.com:name.of.other.server' > /var/qmail2/control/smtproutes
* echo '|/var/qmail2/bin/qmail-inject -A user1@mydomain.com' > ~user1/.qmail
   (repeat as necessary for each user)