<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Start of domains.htm --><!-- delayed after doctype-->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../css2/netwin.css">
	<script type="text/javascript" src="template/js2/netwin.js"></script>
<!--
	<script type="text/javascript" src="template/js2/dbg.js"></script>
-->

<!--
	<link rel="stylesheet" type="text/css" href="template/css2/netwin.css">

	<link rel="stylesheet" type="text/css" href="template/css2/test.css">
	<link rel="stylesheet" type="text/css" href="template/css2/sw.css">
	<link id ="cnr_css" rel="stylesheet" type="text/css" href="template/css2/cnr4.css">
-->

<!--[if lt IE 7]>
	<link rel="stylesheet" href="template/css2/ie6.css" type="text/css" />
<![endif]-->


<!-- Back to domains.htm -->

<!-- #BeginEditable "Headerstuff"-->
<title>Virtual Domains</title>
<META NAME="keywords" CONTENT="">
<META NAME="description" CONTENT="">
<meta http-equiv="Content-Type" content="text/html;">


<!-- #EndEditable -->
</head>
<body class="s_body">


<div id="width_limit_div" class="width_limit" style="padding-bottom:0;">

<!-- HEADER CONTENT -->
<div class="header">
  <div class="search_box"><table valign="center" cellSpacing="0" cellPadding="0" border="0">
	<form id="form1" name="form1" method="GET" action="http://www.google.com/custom">

	  <input type=hidden name=domains id=search_domains value="netwinsite.com">
	  <input type=hidden name=sitesearch id=search_sitesearch value="netwinsite.com">
	  <input type=hidden name=cof VALUE="LW:135;L:http://www.netwinsite.com/img2/logo_med_onwhite.png;LH:44;AH:center;S:http://www.netwinsite.com;AWFID:773914251fd85055;">

	  <tr valign="center">
		<td valign="center" style="padding-right:5px;"><span id="search_description" style="font-family:Verdana,Arial,Helvetica; font-size:9pt; ">Search website:</span>
		</td>
		<td valign="center">
			<input size="15" maxLength="80" name="q" style="font-family: Tahoma, Arial; font-size: 8pt">
		</td>
		<td valign="center">
			<input TYPE="image" src="template/img2/search.gif" alt="Search Netwinsite.com!" Name="I1" style="width:17px;height:17px;margin-left:5px;border:0;">
		</td>
	  </tr>
	</form>
  </table></div>

  <div class="page_logo"><table valign="center" border="0" cellpadding="0" cellspacing="10" >
	  <tr>
		<td style="padding-left:20px;">
		  <a href=""><img border="0" src="template/img2/logo_med_onwhite.png" height="44px" vspace="5" id="main_logo"> </a>
		</td>
		<td>
		  <div style="padding-top:14px;">
			<span class="s_header_text">Advanced Server Software<span>
		  </div>
		</td>
	  </tr>
  </table></div>
</div>

<!-- MENU CONTENT -->
<div class="bar_padding" onmousemove="stopEvent(event);return false;">
	<div class="bar" style="text-align:center">
		<table id="page_menu" class="t menu" onmousemove="menu_handler(event);" style="margin:auto"><tr>
	<td valign=top><table class="top_item" mid="menu_home"><tr><td class="btn_l"><td class="btn_c"><a href="http://netwinsite.com/index.htm" class="pad">Home</a><td class="btn_r"></table>
	<td valign=top><table class="top_item" mid="menu_products"><tr><td class="btn_l"><td class="btn_c"><a href="http://netwinsite.com/products.htm" class="pad">Products</a><td class="btn_r"></table>
	<td valign=top><table class="top_item" mid="menu_download"><tr><td class="btn_l"><td class="btn_c"><a href="http://netwinsite.com/download.htm" class="pad">Download</a><td class="btn_r"></table>
	<td valign=top><table class="top_item" mid="menu_buy"><tr><td class="btn_l"><td class="btn_c"><a href="http://netwinsite.com/prices.htm" class="pad">Buy&nbsp;Now</a><td class="btn_r"></table>
	<td valign=top><table class="top_item" mid="menu_support"><tr><td class="btn_l"><td class="btn_c"><a href="http://netwinsite.com/support.htm" onmouseup="x()" class="pad">Support</a><td class="btn_r"></table>
	<td valign=top><table class="top_item" mid="menu_company"><tr><td class="btn_l"><td class="btn_c"><a href="http://netwinsite.com/company.htm" onmouseup="x()" class="pad">Company</a><td class="btn_r"></table>
		</table>
	</div>

	<div id="menu_home" class="xmenu hidden" onmouseup="menu_hide_ex(event,'menu_home')" onmouseout="menu_action_mouseout(event,'menu_home')" onmouseover="menu_action_mouseover(event,'menu_home')" style="width:220px; display:none;">
	</div>

	<div id="menu_products" class="xmenu hidden" onmouseup="menu_hide_ex(event,'menu_products')" onmouseout="menu_action_mouseout(event,'menu_products')" onmouseover="menu_action_mouseover(event,'menu_products')" style="width:220px;">
		<a href="http://netwinsite.com/surgemail/" class="menu_row pad2"><div class="menu_icon_surgemail"></div>
			SurgeMail<span class="menu_extra"></span><br><span class="menu_info">Fully featured email server </span></a>
		<a href="http://netwinsite.com/surgeftp/" onmouseup="x()" class="menu_row pad2 divider"><div class="menu_icon_surgeftp"></div>
			SurgeFTP<span class="menu_extra"></span><br><span class="menu_info">High performance FTP server </span></a>
		<a href="http://netwinsite.com/dbabble/index.html" onmouseup="x()" class="menu_row pad2"><div class="menu_icon_dbabble"></div>
			DBabble <span class="menu_extra"></span><br><span class="menu_info">Instant messenging server </span></a>
		<a href="http://netwinsite.com/surgeweb/" onmouseup="x()" class="menu_row pad2 divider"><div class="menu_icon_surgeweb"></div>
			SurgeWeb<br><span class="menu_info">Modern Ajax web email client</span></a>
		<a href="http://netwinsite.com/products.htm" onmouseup="x()" class="menu_row divider">
			All products...</a>
	</div>

	<div id="menu_download" class="xmenu hidden" onmouseup="menu_hide_ex(event,'menu_download')" onmouseout="menu_action_mouseout(event,'menu_download')" onmouseover="menu_action_mouseover(event,'menu_download')" style="width:220px">
		<a href="/cgi-bin/keycgi.exe?cmd=download&product=surgemail&" onmouseup="x()" class="menu_row"><div class="menu_icon_surgemail"></div>
			Surgemail<span class="menu_extra"></span></a>
		<a href="/cgi-bin/keycgi.exe?cmd=download&product=surgeftp&" onmouseup="x()" class="menu_row"><div class="menu_icon_surgeftp"></div>
			SurgeFTP<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/dbabble/download.htm" onmouseup="x()" class="menu_row"><div class="menu_icon_dbabble"></div>
			DBabble <span class="menu_extra"></span></a>
		<a href="/cgi-bin/keycgi.exe?cmd=download&product=surgemail&" onmouseup="x()" class="menu_row divider"><div class="menu_icon_surgeweb"></div>
			SurgeWeb</a>
		<a href="http://netwinsite.com/surgemail/help/install.htm" onmouseup="x()" class="menu_row">
			Installing Surgemail</a>
		<a href="http://netwinsite.com/download.htm" onmouseup="x()" class="menu_row">
			Download any product...</a>
	</div>

	<div id="menu_buy" class="xmenu hidden" onmouseup="menu_hide_ex(event,'menu_buy')" onmouseout="menu_action_mouseout(event,'menu_buy')" onmouseover="menu_action_mouseover(event,'menu_buy')" style="width:220px">
		<a href="http://netwinsite.com/prices.htm" onmouseup="x()" class="menu_row divider">
			Pricing</a>
		<a href="http://netwinsite.com/https://netwinsite.com/cgi-bin/keycgi.exe?cmd=buy_new&product=surgemail" onmouseup="x()" class="menu_row"><div class="menu_icon_surgemail"></div>
			Surgemail<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/https://netwinsite.com/cgi-bin/keycgi.exe?cmd=buy_new&product=surgeftp" onmouseup="x()" class="menu_row"><div class="menu_icon_surgeftp"></div>
			SurgeFTP<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/https://netwinsite.com/cgi-bin/keycgi.exe?cmd=buy_new&product=dbabble" onmouseup="x()" class="menu_row"><div class="menu_icon_dbabble"></div>
			DBabble <span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/https://netwinsite.com/cgi-bin/keycgi.exe?cmd=buy_new&product=surgemail" onmouseup="x()" class="menu_row divider"><div class="menu_icon_surgeweb"></div>
			SurgeWeb</a>
		<a href="http://netwinsite.com/activate.htm" onmouseup="x()" class="menu_row">
			Activation guide</a>
		<a href="http://netwinsite.com/prices.htm" onmouseup="x()" class="menu_row">
			Purchase any product...</a>
	</div>

	<div id="menu_support" class="xmenu hidden" onmouseup="menu_hide_ex(event,'menu_support')" onmouseout="menu_action_mouseout(event,'menu_support')" onmouseover="menu_action_mouseover(event,'menu_support')" style="width:220px">
		<a href="http://netwinsite.com/documentation.htm" onmouseup="x()" class="menu_row divider">
			Online documentation<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/surgemail/post.htm" onmouseup="x()" class="menu_row">
			Contact support<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/support.htm#email_list" onmouseup="x()" class="menu_row">
			Standard email support<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/http://news.netwinsite.com:8119/webnews?group=netwin.surgemail&cmd=list" onmouseup="x()"  class="menu_row divider">
			Community forum <span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/support.htm" onmouseup="x()" class="menu_row">
			Support overview...</a>
	</div>

	<div id="menu_company" class="xmenu hidden" onmouseup="menu_hide_ex(event,'menu_company')" onmouseout="menu_action_mouseout(event,'menu_company')" onmouseover="menu_action_mouseover(event,'menu_company')" style="width:220px">
		<a href="http://netwinsite.com/company.htm" onmouseup="x()" class="menu_row">
			About us<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/surgemail/customers.htm" onmouseup="x()" class="menu_row">
			Customers<span class="menu_extra"></span></a>
		<a href="http://netwinsite.com/support.htm#sales_questions" onmouseup="x()" class="menu_row divider">
			Contact us</a>
	</div>
	<div style="background:url(template/img2/white_small.png);height:8px;font-size:1px;"></div>
</div>
<!-- Back to domains.htm -->

<div class="content_outer">


<!-- Back to domains.htm -->
<div class="L2C2_column_left">
<!-- Back to domains.htm -->
<div style="width:160px;">
  <div id="floating_index" class="floating_index nav-menu _document_index" style="width:160px;">
	<h2 class="menu_top">Help Index</h2>
	<ul class="level-0">

		<li class="group_hidden"><a href="#" onclick="index_toggle(event)">Getting Started</a><ul class="level-1">
			<li id="idx_surgemail.htm"><a href="surgemail.htm" target="_top">SurgeMail in a nutshell</a><ul class="level-2"></ul></li>
			<li id="idx_startingoff.htm"><a href="startingoff.htm" target="_top">Before you install</a><ul></ul></li>
			<li id="idx_install.htm"><a href="install.htm" target="_top">Installation &amp; Upgrading</a><ul></ul></li>
			<li id="idx_migration.htm"><a href="migration.htm" target="_top">Migration to SurgeMail</a><ul></ul></li>
			<li id="idx_updates.htm"><a href="updates.htm" target="_top">Change history</a><ul></ul></li>
			<li id="idx_postinstall.htm"><a href="postinstall.htm" target="_top">Post Installation</a><ul></ul></li>
			<li id="idx_faq.htm"><a href="faq.htm" target="_top">FAQ</a><ul></ul></li>
			<li id="idx_support.htm"><a href="support.htm" target="_top">Customer Support</a><ul></ul></li>
		</ul></li>

		<li class="group_hidden"><a href="#" onclick="index_toggle(event)">Anti Spam / Virus</a><ul class="level-1">
			<li id="idx_protected.htm"><a href="protected.htm#virusscanner">Virus Protection</a></li>
			<li id="idx_spam.htm"><a href="spam.htm">Spam Prevention</a></li>
			<li id="idx_protected.htm"><a href="protected.htm#mfilter">Mail Filtering</a> </li>
			<li id="idx_protected.htm"><a href="protected.htm#friends">Friendly Relations System</a></li>
			<li id="idx_rbl.htm"><a href="rbl.htm">Realtime Blackhole Lists</a></li>
		</ul></li>

		<li class="group_hidden"><a href="#" onclick="index_toggle(event)">Server Management </a><ul class="level-1">
			<li id="idx_status.htm"><a href="status.htm">Server Status</a></li>
			<li id="idx_log.htm"><a href="log.htm">Searching the log files</a></li>
			<li id="idx_report.htm"><a href="report.htm">Report generation</a></li>
			<li id="idx_accounts.htm"><a href="accounts.htm">Managing accounts</a></li>
			<li id="idx_tellmail.htm"><a href="tellmail.htm">Using the tellmail utility.</a></li>
		</ul></li>
		
		<li class="group_hidden"><a href="#" onclick="index_toggle(event)">SurgeMail Settings</a><ul class="level-1">
			<li id="idx_domain.htm"><a href="domain.htm">Domain specific settings</a></li>
			<li id="idx_global.htm"><a href="global.htm">Global settings</a></li>
			<li id="idx_webmail.htm"><a href="webmail.htm">WebMail settings</a></li>
		</ul></li>

		<li class="group_hidden"><a href="#" onclick="index_toggle(event)">Configuration Guides</a><ul class="level-1">
			<li id="idx_authent.htm"><a href="authent.htm">Authentication  Modules</a></li>
			<li id="idx_domains.htm"><a href="domains.htm">Virtual  Domains</a></li>
			<li id="idx_clustering.htm"><a href="clustering.htm">Clustering</a></li>
			<li id="idx_mirror.htm"><a href="mirror.htm">Mirror the server</a></li>
			<li id="idx_scalable.htm"><a href="scalable.htm">Performance &amp; Scalability</a></li>
			<li id="idx_lookandfeel.htm"><a href="lookandfeel.htm">Custom look and feel</a></li>
			<li id="idx_internal_email.htm"><a href="internal_email.htm">Custom internal emails </a></li>
			<li id="idx_language.htm"><a href="language.htm">Language translation</a></li>
			<li id="idx_redirection.htm"><a href="redirection.htm">Mail Redirection</a></li>
			<li id="idx_surgewall.htm"><a href="surgewall.htm">SurgeWall</a></li>
			<li id="idx_sms.htm"><a href="sms.htm">SMS</a></li>
			<li id="idx_lists.htm"><a href="lists.htm">Mailing lists and bulletins</a></li>
			<li id="idx_secure.htm"><a href="secure.htm">Securing the server</a></li>
			<li id="idx_webdav.htm"><a href="webdav.htm">WebDav</a></li>
			<li id="idx_incoming.htm"><a href="incoming.htm">Incoming MX servers</a></li>
			<li id="idx_load_balance.htm"><a href="load_balance.htm">Load balancing</a></li>
			<li id="idx_ndb.htm"><a href="ndb.htm">NDB NetWin folder format</a></li>
			<li id="idx_domainkeys.htm"><a href="domainkeys.htm">DomainKeys Support</a></li>
			<li id="idx_ipv6.htm"><a href="ipv6.htm">IPV6 Support</a></li>
			<li id="idx_amazon-ses.htm"><a href="amazon-ses.htm">Amazon-SES gateway</a></li>
			<li id="idx_examples.htm"><a href="examples.htm">Example configurations</a></li>
		</ul></li>
	</ul>
  </div>
  &nbsp;	<!-- required to render div -->
</div>
<script>window.do_scroll_menu=false</script>
<!-- Back to domains.htm -->
</div>

<!-- Back to domains.htm -->

<div class="L2C2_column_content">
<!-- Back to domains.htm -->
<!-- #BeginEditable "Body" -->

  <script language="JavaScript"> search_details('Search SurgeMail Manual:','http://netwinsite.com/surgemail/help'); </script>
  <script language="JavaScript"> display_crumbs_doc(['Home','Documentation','SurgeMail Help Index','Virtual Domains'],3); </script>
  <script language="JavaScript"> index_select('idx_domains.htm'); </script>

  <h1>Virtual Domains - a guide</h1>

  <p><font face="Arial, Helvetica, sans-serif">Unlike web servers there are two
    basic types of virtual domains for a mail server:</font> </p>
  <ul>
    <li><font face="Arial, Helvetica, sans-serif">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.&nbsp;</font></li>
    <li><font face="Arial, Helvetica, sans-serif">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.</font></li>
  </ul>
  <p><font face="Arial, Helvetica, sans-serif">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 eg: *.mydomain.com&nbsp;
    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). </font></p>
  <p><font face="Arial, Helvetica, sans-serif">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'&nbsp;</font> </p>

  <h3><a name="create"></a>How to create a virtual domain</font></h3>
  <p><font face="Arial, Helvetica, sans-serif">Simply click on 'domains' 'add'
    in the web admin tool.&nbsp; Then fill out the details.&nbsp; </font></p>
  <p><font face="Arial, Helvetica, sans-serif">In addition if you are using WebMail
    you may need to add these domains to webmail.ini as <a href="webmail.htm">described</a>.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">Note: </font><font face="Arial, Helvetica, sans-serif">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.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">You can define default settings
    for new domain by creating/editing the domain_defaults.txt file in the SurgeMail
    &quot;web&quot; directory. This file contains only basic settings in the form:</font></p>
  <p><font face="Arial, Helvetica, sans-serif">&lt;setting_name&gt;&lt;space&gt;&lt;setting_value&gt;</font></p>
  <p><font face="Arial, Helvetica, sans-serif">one setting per line. It cannot
    handle the more complex settings eg.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">setting label=&quot;value&quot;
    label2=&quot;value2&quot; </font></p>

  <h3>Adding IP numbers to your operating system</h3>
  <p><font face="Arial, Helvetica, sans-serif">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. </font></p>
  <p><font face="Arial, Helvetica, sans-serif">For UNIX, see <a href="http://www.nethelp.no/net/vif/readme.html">http://www.nethelp.no/net/vif/readme.html</a>
    for more information.&nbsp;</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">As an example, on Linux you would
    do the following:&nbsp;</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">su - root&nbsp;</font> <font face="Arial, Helvetica, sans-serif"><br>
    ifconfig eth0:2 999.59.4.31 up</font> <font face="Arial, Helvetica, sans-serif"><br>
    to add a second IP number 999.59.4.31. The number :2 can be anything between
    :1 and :255&nbsp;</font> </p>

  <h3><a name="domuser"></a>Virtual Domain User (domuser.dat)</h3>
  <p><font face="Arial, Helvetica, sans-serif">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.</font>
  </p>
  <p><font face="Arial, Helvetica, sans-serif">The format is:</font> </p>
  <pre><font face="Arial, Helvetica, sans-serif">delivery_user_domain user_database_lookup_name</font></pre>
  <pre><font face="Arial, Helvetica, sans-serif">e.g.</font></pre>
  <pre><font face="Arial, Helvetica, sans-serif">xxx@bob.com&nbsp; xxx@bob.com
yyy@yyy.com yyy@bob.com
*@ccc.com ccc@bob.com</font></pre>
  <p><font face="Arial, Helvetica, sans-serif">So 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'&nbsp;</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">This file is very efficient and
    can support millions of virtual domains on a single server.</font> </p>

  <h3> <a name="dns"></a>MX records DNS entries etc...</h3>
  <p><font face="Arial, Helvetica, sans-serif">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).&nbsp; When you setup a mail server you
    will need to add a DNS entry.&nbsp; 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.&nbsp;&nbsp;</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">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.&nbsp;</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">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.</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">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:</font> </p>
  <pre><font face="Arial, Helvetica, sans-serif">mail.freemail.com. in a 10.0.0.12</font></pre>
  <p><font face="Arial, Helvetica, sans-serif"><br>
    Alternatively, or as well, you can use MX records. Typically these are used
    to give a backup mail server address, e.g.</font> </p>
  <pre><font face="Arial, Helvetica, sans-serif">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.</font></pre>
  <p><font face="Arial, Helvetica, sans-serif">This says send all Email to mail1.freemail.com
    if possible. Failing that, send to mail2.freemail.com.&nbsp; 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.</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">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.</font>
  </p>
  <p><font face="Arial, Helvetica, sans-serif">Lastly you may want to configure
    wild card entries if you have lots of virtual domains all under a primary
    domain name, e.g.</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">*.freemail.com. mx 10 mail1.freemail.com</font>
    <font face="Arial, Helvetica, sans-serif"><br>
    *.freemail.com. cname mail1.freemail.com</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">Beware - 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.</font> </p>
  <p><font face="Arial, Helvetica, sans-serif">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.</font></p>

  <h3>When mail.your.domain and your.domain are NOT the same system</h4>
  <p><font face="Arial, Helvetica, sans-serif">The basic problem is you want user@your.domain
    to go to your mail server, but you want http://your.domain to go to your web
    server, and they are different systems.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">This is achieved by the following
    magic incantations.</font></p>
  <ul>
    <li><font face="Arial, Helvetica, sans-serif">Add MX records to point your.domain
      to mail.your.domain</font></li>
    <li><font face="Arial, Helvetica, sans-serif">Add aliases for the domain in
      surgemail.ini so it will accept mail for mail.your.domain as well as your.domain,
      host_alias &quot;mail.your.domain&quot; (in each domain)</font></li>
    <li><font face="Arial, Helvetica, sans-serif">Add g_server_name url=&quot;*.domain.com&quot;
      name=&quot;domain.com&quot; so that web connections will figure out the
      right domain</font></li>
    <li><font face="Arial, Helvetica, sans-serif">In webmail.ini the imap server
      etc should be defined as 'mail.your.domain' not 'your.domain' </font> </li>
  </ul>
  <p><font face="Arial, Helvetica, sans-serif">So in your DNS you have:</font></p>
  <ul>
    <li><font face="Arial, Helvetica, sans-serif">mail.your.domain --&gt; x.x.x.x
      (your mail server)</font></li>
    <li><font face="Arial, Helvetica, sans-serif">your.domain --&gt; y.y.y.y (your
      web server)</font></li>
    <li><font face="Arial, Helvetica, sans-serif">your.domain MX --&gt; mail.your.domain</font></li>
  </ul>
  <p><font face="Arial, Helvetica, sans-serif">When you add a domain in SurgeMail
    it will ask you about your 'DNS' and 'MX' names, if you specify them as different,
    it will correctly setup your webmail.ini and surgemail.ini to cope, but you
    still need to setup the correcdt DNS/MX records in your DNS server.</font></p>
  <p></p>

  <h2><a name="domain_id"></a>Domain identification using WebMail with SurgeMail</h2>
  <p><font face="Arial, Helvetica, sans-serif">Webmail combined with surgemail
    can host multiple domains on one server. There are several options for having
    webmail identify the correct domain.</font></p>
  <blockquote>
    <ol>
      <li><font face="Arial, Helvetica, sans-serif"> Web browser URL based(most
        commonly used)</font></li>
      <li><font face="Arial, Helvetica, sans-serif">Domain dopdown list</font></li>
      <li><font face="Arial, Helvetica, sans-serif"> Fully specified login</font></li>
      <li><font face="Arial, Helvetica, sans-serif"> Using IP address</font></li>
    </ol>
  </blockquote>

  <h3>1. Using the web browser URL</h3>
  <p><font face="Arial, Helvetica, sans-serif"><img src="webmail_login1.jpg" border=1></font></p>
  <p><font face="Arial, Helvetica, sans-serif">The normal way of handling multiple
    domains is to login to webmail using your web browser on a URL of http://mydomain.com/scripts/webmail.exe.
    Webmail will then display a login page that has the domain correctly identified.
    For this to work this domain needs to be configured in several places in surgemail
    and webmail.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">The vdomain in question must be
    defined in surgemail:</font></p>
  <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif"><b>surgemail.ini:</b>
  vdomain address=&quot;&quot; name=&quot;mydomain.com&quot;
  	mailbox_path &quot;C:\surgemail\mbox\mydomain.com&quot;
	{... other settings}</font></pre>
  </blockquote>
  <p><font face="Arial, Helvetica, sans-serif"> and in webmail:</font></p>
  <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif">surgemail/web_work/<b>surgehost.ini:</b>
  vhost mydomain.com<br>	  domain mydomain.com<br>	  suffix @mydomain.com<br>	  imaphost 127.0.0.1<br>	  smtphost 127.0.0.1<br>  vend</font></pre>
  </blockquote>
  <p><font face="Arial, Helvetica, sans-serif">The definition of the domain in
    both places is generally done automatically by surgemail when you create this
    domain using the surgemail web admin interface or tellmail commands, but can
    be manually added if required.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">When the browser connects to surgemail
    on the url <b>http://mydomain.com</b>/scripts/webmail.exe, it passes &quot;Host:
    mydomain.com&quot;. SurgeMail matches this host value against g_server_name
    settings, domain names, url_host values and also compares the ip address of
    the domain to the ip being connected to. When it finds a match it passes a
    <b>SERVER_NAME </b>enviroment variable to WebMail with the appropriate value.
    WebMail matches this value against the vhost sections, identifying the domain.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">I</font><font face="Arial, Helvetica, sans-serif">f
    your url does not match your vdomain name eg you want your users to connect
    to <b>http://webmail.mydomain.com</b>/scripts/webmail.exe to send email of
    user@mydomain.com, surgemail will need to do this name translation. If the
    domain has a unique ip, and the url domain resolves to that ip then it should
    automatically work (surgemail 3.7a-21 onward). If you have only 1 such url
    domain name then you can set the domain url_host setting to this value (this
    has the side effect that SurgeMail will also use this value in any url it
    generates internally). If you have several values you can use a g_server_name
    rule, this rule may contain a wildcard. eg. </font></p>
  <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif"><b>surgemail.ini:</b>
  g_server_name url=&quot;*.mydomain.com&quot; name=&quot;mydomain.com&quot;</font>
</pre>
  </blockquote>

  <h3>2. Domain dropdown list</h3>
  <p><font face="Arial, Helvetica, sans-serif"><img src="webmail_login2.jpg" border=1></font></p>
  <p><font face="Arial, Helvetica, sans-serif">An alternative to having webmail
    identify the domain using the web browser URL is to always display a dropdown
    list of all domains. This has the disadvantage that all users will see all
    domains that your server hosts. To display a dropdown in the webmail and user.cgi
    pages use the following settings:</font></p>
  <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif"><b>surgemail.ini:</b>
  g_user_domainlist &quot;user&quot;</font></pre>
  </blockquote>
  <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif"><b>webmail.ini:</b>
  <font face="Arial, Helvetica, sans-serif">domain_select true
</font></font></pre>
  </blockquote>

  <h3>3. Fully specified login</h3>
  <p><font face="Arial, Helvetica, sans-serif"><img src="webmail_login3.jpg" border=1></font></p>
  <p><font face="Arial, Helvetica, sans-serif">An alternative to 1) and 2) above
    is to display an edit box allowing a fully specified login. To setup webmail
    this way remove the thext &quot;@heartoftn.net&quot; from the login.tpl file
    for the template set that you are using.</font></p>
  <p>&nbsp;</p>
  <a name="autologin"></a>

  <h2>Automatic Webmail login</h2>
  <p><font face="Arial, Helvetica, sans-serif">If you wish to automatically login to webmail from another web page / application you have three options:.</font></p>
  <blockquote>
    <ol>
      <li><font face="Arial, Helvetica, sans-serif"> Pass username and password (not generally a good idea)</font></li>
      <li><font face="Arial, Helvetica, sans-serif">Pop based autologin (surgemail only)</font></li>
      <li><font face="Arial, Helvetica, sans-serif"> File based autologin</font></li>
    </ol>
  </blockquote>

  <h3>1. Pass username and password</h3>
  <p><font face="Arial, Helvetica, sans-serif">You can just pass the username and password as fields to webmail login page. This means the password gets sent to the web browser before submission so the password is sent unencrypted across the (possibly unsecure) network. This could even get stored in web server referrer logs if you are unlucky.</font></p>

  <h3>2. Pop based autologin</h3>
  <p><font face="Arial, Helvetica, sans-serif">Use POP based autologin (surgemail mailserver only) This is the default that surgemail uses when logging in to webmail and entails surgemail remembering the encoded password and serving this when webmail asks for it as an extended POP command.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">This requires:</font></p>
  <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif"><b>surgemail.ini:</b>
  g_autologin_pop &quot;true&quot;
<b>webmail.ini:</b>
  use_id_autologin true
</font></pre>
  </blockquote>

  <h3>3. File based autologin</h3>
  <p><font face="Arial, Helvetica, sans-serif">Using file based autologin allows arbitrary applications to login directly to webmail without sending the password in plaintext to the web browser.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">The application that is doing the auto login to surgemail stores the password as an encoded file and sends a token to this file in the url it sends the web browser. Webmail reads this file, stores the password and removes this temporary autologin file. This means the password is not sent across the (possibly unsecure) network.</font></p>
  <p><font face="Arial, Helvetica, sans-serif">This requires:</font></p>
  <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif"><b>webmail.ini:</b>
  use_id_autologin false</font></pre>
  </blockquote>
    <font face="Arial, Helvetica, sans-serif">and if surgemail autologin is also required:</font></p>
    <blockquote>
    <pre><font face="Arial, Helvetica, sans-serif"><b>
surgemail.ini:</b>
  g_autologin_pop &quot;false&quot;</font></pre>
  </blockquote>
  <p> 1- The &quot;central login&quot; application saves the encoded password in a file (encoded as per following logic) in the webmail work folder:<br>
In file 22413.tmp (where 22413 is arbitrary random integer) store the password passed through the auto_login_encode function.</p>
<pre>    char *auto_login_encode(char *name,char *pass,char *enc,int bfsz) {
       // bfsz = size of enc buffer. (Typically 1000 bytes)
       char *n;
       int i;

       for (i = 0,n = name; i &lt; bfsz-1 &amp;&amp; pass[i]; i++) {
          enc[i] = pass[i] + *n++;
          if (!*n) n = name;
       }
       enc[i] = '\0';
       return enc;
    }
</pre>
  <p> 2 - The following url is then passed to the browser, where the critical fields are user, id and auto_login:<br>
    http://myserver.com/scripts/webmail.exe?cmd=auto_login&amp;user=marijn&amp;select_domain=mydomain.com&amp;id=22413&amp;frames=true<br>
    3 - Webmail uses the password from the 22413.tmp autologin temp file and removes the 22413.tmp file.<br>
  </p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>

<!-- #EndEditable -->
<!-- CONTENT END -->
</div>

<!-- Back to domains.htm -->
</div>

<!-- Back to domains.htm -->

<div class="prefooter">&nbsp;</div>
<div id="footer" class="footer">
 <table align="center" CELLPADDING="0" CELLSPACING="0" WIDTH="900" HEIGHT="100" BORDER="0" >
  <tr>
    <td HEIGHT="100%" >
      <p align="center" style="margin-top: 8pt; margin-bottom: 2pt; margin-left: 8pt">
  	  <a href="http://netwinsite.com/sitemap.htm" class="footer_link">Site Map</a><span class="style2"> | </span>
  	      <a href="http://netwinsite.com/index.htm" class="footer_link">Home</a><span class="style2"> | </span>
	      <a href="http://netwinsite.com/products.htm" class="footer_link">Products</a><span class="style2"> | </span>
	      <a href="http://netwinsite.com/surgemail/post.htm" class="footer_link">Contact Netwin</a><span class="style2"> | </span>
	      <a href="http://netwinsite.com/company.htm" class="footer_link">Company</a><span class="style2"> | </span>
	      <a href="http://netwinsite.com/license_all.htm" class="footer_link">Licensing</a><span class="style2"> | </span>
	      <a href="http://netwinsite.com/links.htm" class="footer_link">Links</a><span class="style2">  </span>
		<br>
		<a href="/surgemail/" class="footer_link">Windows Mail Server Software</a><span class="style2"> |  </span> 
		<a href="/webmail/" class="footer_link">Linux Webmail</a><span class="style2"> | </span> 
		<a href="/surgemail/free_mail_server.htm" class="footer_link">Free Windows Mail Server</a>

        <table align=center width="370" border="0" style="margin-bottom: 2pt">
        <tr>
          <td width="32"><img src="template/img2/logo_small_ongray.png" height="25" hspace="1" vspace="1" align="bottom"></td>
          <td width="350"><p class="smaller" style="margin-top: 14pt;">Copyright &copy; 2011 Netwin Ltd. All rights reserved.
		  </td>
        </tr>
      </table>
	</td>
  </tr>
</table>
</div>
</div>

<br><br>
</body>

<!-- Back to domains.htm -->

</body>
</html>

<!-- End of domains.htm -->

