วันอาทิตย์ที่ 6 พฤษภาคม พ.ศ. 2550

Host Domains

Host Domains
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 added 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, you will need to setup what we call 'virtual domains'. Please read on ...

ที่มา

http://netwinsite.com/dmail/domains.htm

Domains

Domains
The whole of the DMail server is based around the email address domain.

All you have to do is tell the DMail servers which email domain or domains you want it to recognize as being 'local'.

You do this by using two settings - host_domain and vdomain in The configuration file - dmail.conf.

If you want to support just one domain, use a host_domain setting.

If you want to support multiple domains, use a host_domain setting plus a number of vdomain settings.

If you are planning to add many domains, we suggest that you pick one of these domains to be your 'main' domain.

Use DMSetup to add only this domain and get it working so that you can send and receive email. Only then should you set about adding the other domains.

The other domains that you add are refered 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.

ที่มา

http://netwinsite.com/dmail/domains.htm

Virtual Domains

Virtual Domains
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 should be thought 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: there isn't really any difference between a main domain and a virtual domain, except for 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

ที่มา

http://netwinsite.com/dmail/domains.htm

Adding an IP based Virtual domain - Explanation 1

Adding an IP based Virtual domain - Explanation 1
Both domain1.com and domain2.com point to a single machine with multiple IP numbers running one copy of DPOP. In order to handle these two 'virtual-domains' and not mix up fred1 and fred2, even though they have the same username, DPOP must keep them separate. When a connection is made to DPOP, it checks the IP number that the connection was made to. This is then matched against entries in the dmail.conf file of the form;

vdomain Btwo 161.33.44.55 mail.domain.one /var/spool/mail/B
vdomain C 222.33.44.22 mail.domain.two /var/spool/mail/domaintwo

The entries in these virtual domain lines are as follows:

vdomain <1> <2> <3> <4>


Prefix string used to identify this domain (by default prepended to drop file name)
IP number users reading from this domain will connect to
domain name which translates to number in part 2 above
path for drop files for users of this domain.
These are used to enable the username passed to the authentication process to contain enough information to allow the two users to be distinguished and assigned different drop file paths and passwords.
From the above, it might appear that virtual domains can only be supported when an external authentication process is used, as two different passwords for user fred are required. This is not the case, as virtual domains can also be supported using normal UNIX user/passwords or Windows passwords by using the following scheme:


User fred from domain one is 'known' by the DMail servers as A_fred and user fred from domain B is known as B_fred. So their drop files will be a_fred and b_fred respectively (if drop_prefix is true, which is the default) and their user database names will also be a_fred and b_fred.
The usernames and uid's use the form A_fred and B_fred in order to keep them separate.

The user does not need to change their email client login username settings, as the translation from fred to A_fred is done by DPOP. The vdomain prefix can be a string rather than a single letter, e.g. 'domaina'.

Connections to IP numbers not listed in vdomain settings, but listed in host_domain settings will use the normal drop_path form and will have normal usernames, dropfile and binfile names.
The drop file path for for each virtual domain is specified in the vdomain setting
If a bin path has been specified for bin files then this is used for all domains, BUT a prefix of A_ B_ etc. is used to distinguish files for users from different virtual domains (If drop_prefix is true, which is the default).
If bin files are stored in the same place as drop files then the drop paths from vdomain settings are used.

ที่มา

http://netwinsite.com/dmail/domains.htm

Adding an IP based Virtual domain - Explanation 2

Adding an IP based Virtual domain - Explanation 2
Basically, in order 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: 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.


ที่มา

http://netwinsite.com/dmail/domains.htm

Adding a Suffix based Virtual domain

Adding a Suffix based Virtual domain
As an alternative to having multiple IP numbers, virtual domains can be set up by asking users of the virtual domain to connect to the POP server with a suffix on the end of their username. E.g. using POP login usernames of the form,
fred/jds

To make a virtual domain a 'suffix based vdomain', you add a vdomain line to dmail.conf as with an IP based vdomain, but replace the IP Address with the unique suffix for that domain.

For example, we might have:

vdomain johns /jds johns.server.com /var/spool/mail/johnsusers
where '/jds' is the suffix.

If DPOP finds this suffix on any user POP login name, it will remove the suffix and treat the user as belonging to the vdomain of the vdomain line that it matches.

DPOP will do this no matter what IP address the user connects to.

See IP Address based virtual domains for explanations of the other values of the vdomain setting beside the suffix.

Note: the suffix includes any separator character, in the example above it was '/'.

Making suffixes more convenient:

Obviously, this form of virtual domains can be an inconvenience to users if they have to change their client software settings to connect as 'username_suffix' instead of just 'username'. It can also be a little confusing to customers.

1. One common way to get around this is to make the suffix, '@domain' so that the user can use their email address as their POP login, e.g. if we changed the vdomain line above to,

vdomain johns @johns.server.com johns.server.com /var/spool/mail/johnsusers
Then the suffix is now, '@johns.server.com', so the user fred would login to the POP server with,
fred@johns.server.com

NB: The only problem with this is that some email clients won't let you enter a username with an @ in it. The notable example is Netscape Mail, although the word is that they have realised their mistake and will change that in an upcoming version.

We have just been given instructions on how to allow the @ character to be used in netscape.
1. Close Netscape
2. Edit /program files/netscape/user/prefs.js (right click - open with notepad)
3. Add new line:
user_pref("mail.allow_at_sign_in_user_name", true);
4. Save file
5. Open Netscape



So, if you are going to do this, and have users connecting directly to the POP server with any client, then we suggest you create a second vdomain line for the same domain. The second vdomain line must come after the main vdomain line in dmail.conf. It differs from the first only in that it specifies a different suffix.

So using our example above, you can change,

vdomain johns /jds johns.server.com /var/spool/mail/johnsusers
to,

vdomain johns /jds johns.server.com /var/spool/mail/johnsusers
vdomain johns @johns.server.com johns.server.com /var/spool/mail/johnsusers

NOTE: The above example defines ONE virtual domain, so the same PREFIX 'johns' is used for all three, the prefix must not be the same for different virtual domains, and must not include an underscore character

2. Another common way to make suffixes more 'transparent' is to hide them all together. If you are using any of our Web to EMail gateway products like CWMail or WebMail, they have an ini setting called 'suffix'. You can use that setting to make them automatically add the suffix to the username given by the user on login. So if the user always collects their mail with the web interface, they don't ever need to know about the suffix.

We recommend the use of suffix based vdomains when using the web interfaces.

Remember that whether a vdomain is IP address based or suffix based, the form of the username in the database is independent. So you can easily change a domain from one to another at a later date. For some changes you would need to alter your DNS entries as well.


ที่มา

http://netwinsite.com/dmail/domains.htm