Re: [exim] Building virtual domain on multiple mail server

Top Page
Delete this message
Reply to this message
Author: lee
Date:  
To: exim-users
Subject: Re: [exim] Building virtual domain on multiple mail server
On Sat, Nov 22, 2008 at 02:58:45PM +0800, Stephen Liu wrote:

> domains and their users are stored on the database, MySQL. But I
> haven't resolved how to route them to the respective mail servers,


It is not possible to route the related network traffic that comes in
to a single IP address in such a manner that, depending on to which of
the mail servers behind the single address the traffic should be
directed, it will be directed to the mail server it should be directed
to. This is so because the information to which mail server the
traffic should be directed is not available to the router.

In a way, this information is implicitly given by the IP the traffic
is directed to. One IP is one target, not many targets. A distinction
between many targets *behind* a single IP can be made by using
different ports. For your application, that is not helpful because the
network traffic your mail servers are supposed to receive is required
to use the same ports for all servers.

To access the information to which server traffic is to be directed,
the router would have to analyze what data is actually transfered
within the network traffic coming to the single IP address. In a way,
the "router" analyzing this traffic *is* the mail server that
*receives* (as opposed to *routes*) the traffic.

That's why what you are trying to do is possible with a *single* mail
server behind the single IP address but not with multiple mail servers
behind the single IP address. None of the mail servers has any way to
figure out if network traffic it receives is for *this* mail server or
any of the others.


To give a simple example: The mailman wants to deliver a christmas
package your grandma sent to you. You are living in an appartment
building (your single IP addresss) that has 300 appartments (your mail
servers, "living" at that address). All the appartments have the same
address because they are in the same building. How is the mailman
supposed to figure out to which *appartment* he needs to deliver the
letter? He doesn't have any other information for that than the
address of the appartment building.

He might drop off the package at the entrance of the building. Anyone
who lives in the building can happen to come along and pick up the
package. That *might* be you, or someone else --- and since there are
so many other people, it's not very likely that you will ever get the
package.


However, you could try to set up one main mail server that recieves
all related network traffic that comes in on the single IP. That mail
server could analyze the data in the traffic and then route the mail
(not the traffic) to the other servers, depending on for what domain
the mail is and on what server serves which domain. The
domain-specific servers could in turn use the main server as a
smarthost for their outgoing traffic. But you don't need to do it that
way because you can set up one mail server to serve many different
domains --- call them virtual domains if you want to.


--
http://en.wikipedia.org/wiki/Posting_style