Domains
The whole of the DMail server is based around the email address domain.
All you have to do is tell the DMail servers what email domain or domains you want it to recognise
as being 'local'.
You do this using two settings, host_domain and vdomain in The configuration file - dmail.conf.
If you want to support just one domain then you use a host_domain setting.
If you want to support multiple domains then you use a host_domain setting plus a number of
vdomain settings.
If you are planning to add many domains, then we suggest that
you pick one of these domains to be your 'main' domain.
Use DMSetup to
add only this domain, get it working such that you can send and receive
email, and only then set about adding the other domains.
The other domains
that you add we refer to in this manual as 'virtual domains' although there
is very little difference between them and your main domain.
NB: if you don't tell DMail about a domain with a host_domain or vdomain setting then the SMTP server,
DSMTP, will
think that that domain is not 'local' and try to send on or 'relay' that mail to an outside world server.
On this page...
Related links (not on this page)
The first (top) host_domain setting found in the dmail.conf file
specifies the 'main domain' of the server.
This is the most important setting in your dmail.conf configuration file.
This domain should be what the outside work knows your domain as,
e.g. for us our domain is netwinsite.com so on our server we have set,
host_domain netwinsite.com
Your first host_domain therefore must be resolvable to an IP address
if you are using DSMTP on the internet rather than on an intranet. It is often the
A Name in your DNS record.
NB: your first host_domain setting should almost never be your machine name, e.g.
do not make your first host_domain setting any of the following,
host_domain mail1.domain.com (bad - do not use as first host_domain)
host_domain smtp.domain.com (bad - do not use as first host_domain)
You can set multiple host_domain settings.
The second, third, fourth ... settings are all 'domain
aliases' of your main domain. So you can enter your machine name as one of the lower host_domain
settings. Because the domains are aliases, a particular username points to the same
user on all of the domains,e.g.,
bob@host_domain1
bob@host_domain2
bob@host_domain3
are all the same user, as host_domain1, host_domain2 and host_domain3 are all aliases of each other.
NB: if you add a host_domain setting then in most cases you should ensure that you have also add
a DNS entry for that domain to the Internet DNS server system, i.e. your own DNS server or your ISP's
DNS server. See the Domain Name Resolution (DNS) section towards
the end of this page for details.
For further details on the host_domain setting see the reference
section.
If you require the same username to be used for different users on each domain, then you need to
setup what we call 'virtual domains'. Please read on ...
Virtual domains allow you to provide email server support for
several distinct groups of users who collect their email from supposedly different mail servers.
Such users typically have different domain information in their email address, e.g one
group have addresses on the domain, domain1.com and another group have addresses on domain2.com.
DSMTP accomodates these groups by dividing them based on their domain.
The first domain that you set up you should think of as your 'main
domain'.
So you pick one of your domains that is going to be the default and
call that the main domain. Referring to the section above you add a host_domain setting for it.
Then all of the other domains that you add will be virtual domains.
Note that there isn't really any difference between a main
domain and a virtual domain, except in how you tell DMail about them.
( Repeating our message from the overview ...
The setup program DMSetup will only ask
you about one domain, so forget about the virtual domains until you
have your first main domain set up and tested, i.e. so that you can
send and receive mail. Then set about adding the other domains, with the vdomain
configuration file setting. )
The biggest difficulty for virtual domains is the POP server login usernames.
For example there may be two distinct users both with username fred, let
us call them fred1 and fred2
-
Fred1 has the email address, fred@domain1.com
-
Fred2 has the email address, fred@domain2.com
The DPOP server has to have a method to tell these two users apart when they login, as
presumably they both want the login username of simply 'fred'.
DMail provides two ways to do this,
- IP Address based domains:
Pop users on each domain login to a different IP Address.
So for example fred@domain1.com
might login to ip address 1.1.1.1 with username fred and fred@domain2.com might login to ip address
1.1.1.2 also with username fred.
- Suffix based domains:
Pop users on each domain login with a different suffix to their username.
For example, fred@domain1.com logs on to any IP Address with the username,
fred
and fred@domain2.com logs on to any IP Address with the username,
fred@domain2.com
A third method also exists where every login username is unique and you use aliases or a
lookup table to create mail addresses. This method is common in products like Sendmail, but
it is not recommended by us, see the section,
Unique Usernames Method for Semi Virtual Domains
for details.
So how do you add a virtual domain . . .?
You need to manually add (or use the windows GUI DMAdmin) the virtual
domains to the configuration file, dmail.conf - see
The Configuration File for how to locate and edit this file.
The following links to this page take you through the options. (It can be tricky to get your head
around so we have provided two explanations of IP based virtual domains.)
- Adding an IP based Virtual domain - Explanation 1
- Adding an IP based Virtual domain - Explanation 2
- Adding a Suffix based Virtual domain
Adding an IP based Virtual domain - Explanation 2
Basically to add a virtual domain domain2.com which has IP address
1.1.1.2 you should add a line like,
vdomain dom2 1.1.1.2 domain2.com c:\dmail\in\domain2
In the line above I have chosen a vdomain 'prefix' of dom2, this
prefix is used by DMail to refer to users of this domain, so the user
bob from the domain, domain2 is referred to by DMail as dom2_bob -
never to his face only when it is talking to the authentication
programs (a system one or an external one).
The last entry on the line is the path for mail drop files to go for
that domain - so that you can keep the mail for each domain separate.
You should notice that all of the entries in the vdomain line, except
for the vdomain prefix, are already in your dmail.conf file for your
main domain - e.g. the main domain has a setting called drop_path.
Note that the main domain does not have a prefix, as
usernames without a prefix in your password list are assumed to be
for the main domain.
So to add a user bob to your main domain, you simply add the user
'bob' to your authentication database, and to add a user bob to the
domain domain2 above you add a user 'dom2_bob' to your authentication
database.