| |
![]() |
|||||
| |
|
|
|
|
|
|
| |
||||||
Virtual Domains - a guide
Unlike web servers, there are two basic types of virtual domains for a mail server:
- Real IP based virtual domains, where you have allocated an IP address to each virtual domain, the server can use this information to figure out which domain it should 'pretend' to be.
- Fake ones, where you only use a single IP address, then the user must login as 'user@domain.name' when fetching their Email via POP so that the server can figure out which domain they belong to.
SurgeMail supports both of these methods or even combinations of them and any number of virtual domains. However, it supports some other systems too :-). For example, you can tell SurgeMail to respond to all domains matching a specific wild card, e.g. *.mydomain.com You can also use a virtual user table where each user is in a 'domain of their own' (this is useful if you want to sell users their own domain names).
In addition, some mail clients do not allow a user to specify user@domain.name as their 'username'. In this case you can define a domain separator like '/' and then the user can login as 'user/domain.name'
How to create a virtual domain
Simply click on 'domains' 'add' in the web admin tool. Then fill out the details.
In addition if you are using WebMail you may need to add these domains to webmail.ini as described.
Note: SurgeMail will not create the directory structure until a message is received for the new domain, so don't panic if you can't see the domains directory right away.
Adding IP numbers to your operating system
It is fairly easy to add multiple IP numbers for a single machine, up to 255 per interface is fairly straightforward. 1024 is usually possible with minor patches. The exact method varies. On NT, just specify extra numbers in the networking control panel. For UNIX, see http://www.nethelp.no/net/vif/readme.html for more information.
As an example, on Linux you would do the following:
su - root
ifconfig eth0:2 999.59.4.31 up
to add a second IP number 999.59.4.31. The number :2 can be anything between :1 and :255Virtual Domain User (domuser.dat)
If every user on your system is in their own domain, e.g. bob@jones.mail.com, john@smith.mail.com then you probably don't want to create a virtual domain entry in surgemail.ini for all 200,000 users. Instead, you can use the file domuser.dat to list each user so that SurgeMail knows what virtual domains exist on your system.
The format is:
delivery_user_domain user_database_lookup_namee.g.xxx@bob.com xxx@bob.com yyy@yyy.com yyy@bob.com *@ccc.com ccc@bob.comSo with the above file, if a user 'fred@ccc.com' logged in they would be looked up in the userdatabase as 'ccc@bob.com' and yyy@yyy.com would be looked up as 'yyy@bob.com'
This file is very efficient and can support millions of virtual domains on a single server.
MX records DNS entries etc...
DNS stands for "Distributed Name Server", and it is the mechanism whereby your.domain.name is translated into your IP number (e.g. 13.2.44.2 etc). When you setup a mail server you will need to add a DNS entry. Normally this is done when you register a domain. Your domain registration service should also let you specify the IP number that your computer uses.
In addition, they may let you specify MX records. These are used as an over-ride, as a mail server for xxx.com may not run on the same computer that handles web pages for xxx.com. Also for redundancy you can specify 2 or more computers to receive Email for your domain, so if one system is down the other will accept the mail and hold it until your main system is up.
All the following examples really only apply to you if you run your own DNS server. Most likely someone else is running one for you (your ISP or domain registrar), so they will be adding these entries, but you still need to understand these entries so you know what to ask them to add to their DNS server.
For your mail server to work you must at least have a DNS or MX entry for your system e.g. typical entries look like this:
mail.freemail.com. in a 10.0.0.12
Alternatively, or as well, you can use MX records. Typically these are used to give a backup mail server address, e.g.mail.freemail.com. mx 10 mail1.freemail.com. mail.freemail.com. mx 20 mail2.freemail.com. mail1.freemail.com. in a 10.0.0.12 mail2.freemai.com. in a 10.0.0.13 mail.freemail.com. cname mail1.freemail.com.This says send all Email to mail1.freemail.com if possible. Failing that, send to mail2.freemail.com. Then the next two lines give the IP addresses of those two systems, and the last line is for dumb systems that don't know how to do MX lookups so they will find the primary system anyway.
Often you would setup the low priority MX entry to point to a system outside your local LAN, but if so, you must ensure they are configured to allow forwarding of Email to your system. Then, while your system is down, they will collect incoming Email for you.
Lastly, you may want to configure wild card entries if you have lots of virtual domains all under a primary domain name, e.g.
*.freemail.com. mx 10 mail1.freemail.com
*.freemail.com. cname mail1.freemail.comBeware - wild card entries are not as simple as they look. In particular, it cannot be guaranteed if the MX or IN entry will be used.
You should also specify a reverse DNS entry for your mail server. If you don't, some other mail servers might treat you as a spammer and block or ignore all your Emails.