The main problem of serving multiple domains on one server is to provide access to accounts in different domains. To look for the specified Account, the server should get the name of the Domain to look in.
Access to Accounts is similar to E-mail delivery and Signal processing: the server needs to know the "full Account name" - an address in the accountName@domainName form.
There are several methods to pass the domain name to the server:
- A client application explicitly specifies the domain name.
- If a user accesses the Server via the HTTP (Web interface), this happens automatically: the user first specifies the server URL (http://domainname:port), and then enters the Account name in the Login form.
Since all modern browsers pass the original URL to the server, the domain name becomes known, and the HTTP module immediately appends that domain name to a simple user name specified in the Login form.
- If a user accesses the Server using an XMPP, this happens automatically: the user first specifies the server name in the client application settings, and the client application sends that data as the 'to' attribute in the XML streams.
- If users access the Server with POP or IMAP mailers, they can specify the full account name in the mailer "account name" settings.
Since many mailers do not accept the @ symbol in account names, the % symbol can be used instead.
The user john with an Account in the secondary Domain client1.com should specify the Account name as john%client1.com, not just as john.
- If users access the Server with XIMSS client applications, these applications always specify the full Account name for the authentication operations.
- The domain name can be detected using multihoming. If it is impossible to force users to access the server via the Web interface or to make them enter full account names in their POP/IMAP mailers, multihoming can be used.
A server is using multihoming if the server computer has more than one Internet (IP) address. Using the Domain Name System (DNS) the secondary domains can be assigned different IP addresses.
If a secondary Domain has an IP address assigned to it, and a user connects to that IP address, all simple account names specified with the user mailer are processed as names in that Domain.
It may be difficult to assign an IP address to each Domain, so this method should be used only if it is impossible to make users specify domain names explicitly.
These methods can be used together: a limited number of Domains can be served using dedicated additional IP addresses, while other Domains are served using explicit domain name specifications.