home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / ims.cab / smdomed.asp < prev    next >
Text File  |  1997-10-20  |  36KB  |  1,295 lines

  1. <%
  2. '----------------------------------------------------------------------------
  3. '
  4. '
  5. '   File: smdomed.asp
  6. '
  7. '   Description: Domain Editor
  8. '
  9. '   Copyright (C) 1997 Microsoft Corporation
  10. '
  11. '------------------------------------------------------------------------------%>
  12. <% Response.Expires = 0 %>
  13.  
  14. <%
  15. SMTP_DROP             = 1 ' 0x00000001 local, norma w/non-empty drop dir 
  16. SMTP_SMARTHOST         = 2 ' 0x00000002 remote w/ UseSSL not checked 
  17. SMTP_SSL             = 4 ' 0x00000004 remote w/ UseSSL checked 
  18. SMTP_ALIAS            = 16 ' 0x00000010 local, alias 
  19. SMTP_DELIVER        = 32 ' 0x00000020 local, normal w/ empty drop dir
  20. SMTP_DEFAULT        = 64 ' 0x00000040 local, default 
  21. SMTP_DOMAIN_RELAY    = 4096    '0x00001000 Relay Flag
  22.  
  23. REM Begin localization 
  24.  
  25. L_DOMAINNAME_TEXT            = "Domain Name:" 
  26. L_ADD_DOMAIN_ON_TEXT        = "Add Domain on" 
  27. L_EDITDOMAIN_TEXT             = "Edit Domain on" 
  28. L_LOCALDOMAIN_TEXT             = "Local Domain" 
  29. L_DEFAULTLOCAL_TEXT            = "Default Local Domain" 
  30. L_ALIASLOCAL_TEXT            = "Alias Local Domain" 
  31. L_NORMAL_TEXT                = "Normal Local Domain" 
  32. L_DROPDIR_TEXT                = "Drop Directory:" 
  33. L_REMOTEDOMAIN_TEXT            = "Remote Domain" 
  34. L_ROUTE_TEXT                = "Route Domain:"
  35. L_USESSL_TEXT                = "Use TLS" 
  36. L_ALLOWETRN_TEXT            = "Allow ETRN"
  37. L_EDITDOMPROP_TEXT            = "Edit Domain Properties"
  38. L_ADDDOMAIN_TEXT            = "Add Domain"
  39. L_OK_TEXT                    = "OK"
  40. L_CANCEL_TEXT                = "Cancel"
  41. L_HELP_TEXT                    = "Help"
  42. L_ONLYDEFAULT_TEXT            = "You must have a default domain. \n\nTo change the default domain, go to the property page for the domain you want to change and set it as the default domain."
  43. L_NOTIMPLEMENTED_TEXT        = "This feature not yet implemented."
  44. L_ENTER_DROP_DIR_TEXT        = "Please enter a drop directory path."
  45. L_CHOOSE_DOMAIN_TYPE_TEXT    = "You haven't choosed an actual Domain Type"
  46. L_PATH_SYNTAX_INCORR_TEXT    = "The Path syntax is incorrect."
  47. L_ENTER_DOMAIN_NAME_TEXT    = "Please enter a Domain name."
  48. L_OUTBOUNDSECURITY_TEXT        = "Outbound Security..."
  49. L_OUTBOUND_SECURITY_TITLE_TEXT    = "Outbound_Security"
  50. L_NEWERROR_ERRORMESSAGE        = "You cannot make a new domain the default, create an alias domain first then edit it to make it the Default Domain."
  51. L_ALLOW_INCOMING_RELAY_TEXT    = "Allow incoming mail to be relayed to this domain."
  52. L_INVALID_DOMAIN_NAME_ERRORMESSAGE    = "Invalid domain name."
  53. L_NO_DOMAIN_NAME_ERRORMESSAGE    = "You must enter a name for this domain."
  54. L_DOMAIN_TEXT    = "Domain "
  55. L_ALREADYEXISTS_ERRORMESSAGE    = " already exists."
  56. L_NEW_DOMAIN_SEC_TEXT        = "You cannot edit the OutBound Security properties until you save this domain."
  57.  
  58. DOMAINS_TEXT    = "domain"
  59.  
  60. REM end localization
  61.  
  62. %>
  63.  
  64. <% REM Domains Page add/edit pop-up %>
  65.  
  66. <% REM Get variables %>
  67. <% REM svr = Server name %>
  68. <% REM a = Action to be performed by server-side code (new/add,edit/save) %>
  69. <% REM DirVirtualName = Virtual Directory being edited %>
  70. <% REM DirHome = Whether a home directory already exists for service %>
  71.  
  72. <% svr = Session("svr") %>
  73. <% a = Request("a") %>
  74. <% DomainName = Request("DomainName") %>
  75. <% DirHome = Request("DirHome") %>
  76. <% DomainIndex = Request("index") %>
  77. <% RouteDomain = Request("hdnRouteDomain") %>
  78. <% ServerInstance = Session("ServiceInstance")
  79. if (ServerInstance = "") then
  80.     ServerInstance = Request("ServiceInstance")
  81.     if (ServerInstance = "") then
  82.         ServerInstance = "1"
  83.     end if
  84. end if
  85. Session("ServiceInstance") = ServerInstance
  86. %>
  87.  
  88. <% REM Include _cnst file to force logon by anonymous users (if access denied, body of file ignored) %>
  89.  
  90. <!--#include file="_cnst.asp" -->
  91. <!--#include file="smerrors.asp" -->
  92.  
  93. <% if (cont = true) then %>
  94. <script language="javascript">
  95. <%
  96.  
  97. if (Session("svr") = "") then
  98.     Session("svr") = Request.ServerVariables("SERVER_NAME")
  99. end if
  100. svr            = UCase(Session("svr"))
  101.  
  102. if (dpath = "") then
  103.     dpath = "IIS://" & svr & "/SmtpSvc"
  104. end if
  105. Session("dpath") = dpath
  106.  
  107. szServerString = dpath & "/" & ServerInstance
  108. szDomainString = szServerString & "/" & "Domain"
  109. szDomainClassString = "IIsSmtpDomain"
  110. Dim szRouteDomain 
  111. szRouteDomain = RouteDomain
  112.  
  113. On Error Resume Next
  114. Set admin = GetObject(dpath)
  115. if (Err <> 0) then 
  116.     szError = GetErrorMessage(Err) %>
  117.     alert("<% = szError %>");
  118. <%    end if %>
  119.  
  120. <% On Error Resume Next %>
  121. <% Set VServer = GetObject(szServerString) %>
  122. <% if (Err <> 0) then
  123.     szError = GetErrorMessage(Err) %>
  124.     alert("<% = szError %> : <% = Err %>");
  125. <% end if %>
  126.  
  127. <% On Error Resume Next %>
  128. <% set smtpDomain = GetObject(szDomainString) %>
  129. <% if (Err <> 0) then
  130.     szError = GetErrorMessage(Err) %>
  131.     alert("<% = szError %> : <% = Err %>");
  132. <% end if
  133.  
  134. Dim szDomains() REM Arry to hold domain names
  135.  
  136. iCount = 0
  137. for each child in smtpDomain
  138.     if (child.KeyType = "IIsSmtpDomain") then
  139.         iCount = iCount + 1
  140.     end if
  141. next 
  142.  
  143. ReDim szDomains(iCount)
  144. iLoop = 0
  145. szDomains(0) = VServer.DefaultDomain
  146. for each child in smtpDomain
  147.     if (child.KeyType = "IIsSmtpDomain") then
  148.         iLoop = iLoop + 1
  149.         szDomains(iLoop) = child.name 
  150.         if (child.name = "") then
  151.             szDomains(iLoop) = " "
  152.         end if
  153.     end if
  154. next
  155.  
  156. DropDirectory = VServer.DropDirectory
  157. szDropDirectory = VServer.DropDirectory
  158.  
  159. low = LBound(szDomains)
  160. high = HBound(szDomains)
  161.  
  162. On Error Resume Next
  163. iNumOfDomains = iCount + 1
  164. if (Err <> 0) then
  165.     szError = GetErrorMessage(Err) %>
  166.     alert("<% = szError %>");
  167. <% end if 
  168.  
  169. if a = "new" then
  170.     DomainIndex = (iCount + 1)
  171. end if
  172. %>
  173. </script>
  174. <HTML>
  175. <HEAD>
  176. <% REM Generic Javascript function nnisFull returns alert if field is empty %>
  177. <!--#include file="smisfull.htm" -->
  178. <!--#include file="smchklen.htm" -->
  179.  
  180. <SCRIPT LANGUAGE="javascript">
  181.  
  182.  
  183. function onOK()
  184. {
  185.     uform = document.userform;
  186.  
  187.     if(checkDomainName())
  188.     {
  189. <%    icomp = 0
  190.     icomp = (actionType And SMTP_DEFAULT) or (actionType And SMTP_ALIAS)
  191.     if (icomp <> 0) then %>
  192.         if (uform.txtDropDir.value != "")
  193.         {
  194.             if (GetActionType() == true)
  195.             {
  196.                 var myDirString = new String (uform.hdnDropDir.value);
  197.                 if((myDirString.indexOf("%")) == (-1))
  198.                 {
  199.                     uform.hdnDropDir.value = escape(uform.hdnDropDir.value);
  200.                 }
  201.                 document.userform.submit();
  202.             }
  203.             
  204.             return;
  205.         }
  206.         else
  207.         {
  208.             uform.txtDropDir.value = "<% = RouteDomain %>";
  209.             return;
  210.         }
  211. <%    else %>
  212.         if (GetActionType() == true)
  213.         {
  214.             var myDirString = new String (uform.hdnRouteDomain.value);
  215.             if((myDirString.indexOf("%")) == (-1))
  216.             {
  217.                 uform.hdnRouteDomain.value = escape(uform.hdnRouteDomain.value);
  218.             }
  219.             flipAllow(uform.chkAllowRelay);
  220.             document.userform.submit();
  221.         }
  222.         return;
  223. <%    end if %>
  224.             
  225.     }
  226. }
  227.  
  228. function checkDomainName()
  229. {
  230.     uform = document.userform;
  231.     if(uform.txtDomainName.value == "")
  232.     {
  233.         alert("<% = L_NO_DOMAIN_NAME_ERRORMESSAGE %>");
  234.         return false;
  235.     }
  236.     else
  237.     {
  238. <% if (a = "add") then %>
  239.         szTest = new String();
  240. <%        for iLoop = 0 to iCount %>
  241.             szTest = "<% = szDomains(iLoop) %>";
  242.             if (szTest == uform.txtDomainName.value)
  243.             {
  244.                 alert("<% = L_DOMAIN_TEXT %>" + szTest + "<% = L_ALREADYEXISTS_ERRORMESSAGE %>");
  245.                 uform.txtDomainName.focus();
  246.                 return false;
  247.             }
  248. <%        next %>
  249.         return true;
  250.  
  251. <% end if %>
  252.     }
  253.     return true;
  254.  
  255. }    
  256. function GetActionType()
  257. {
  258.     uform = document.userform;
  259.     <% if (a = "edit") then %>
  260.         document.userform.a.value = "save";
  261.     <% elseif (a = "new") then %>
  262.         document.userform.a.value = "add";
  263.     <% end if %>
  264.     uform.newActionType.value = uform.newActionType.value & ~<% = SMTP_DROP %>;
  265.     uform.newActionType.value = uform.newActionType.value & ~<% = SMTP_SMARTHOST %>;
  266.     uform.newActionType.value = uform.newActionType.value & ~<% = SMTP_ALIAS %>;
  267.     uform.newActionType.value = uform.newActionType.value & ~<% = SMTP_DELIVER %>;
  268.     uform.newActionType.value = uform.newActionType.value & ~<% = SMTP_DEFAULT %>;
  269.  
  270.  
  271.     if(uform.txtDomainName.value != "")
  272.     {
  273.         uform.newDomainName.value = uform.txtDomainName.value;
  274.         if((uform.rdoDomainLocal[0].checked) && (uform.rdoDomainType[0].checked))
  275.         {
  276.             if(uform.txtDropDir.value != "")
  277.             {
  278.                 uform.newDropDir.value = escape(uform.txtDropDir.value);
  279.             }
  280.             uform.newActionType.value = <%= SMTP_DEFAULT %>;
  281.             return true;
  282.         }
  283.         else if((uform.rdoDomainLocal[1].checked) && (!(uform.newActionType.value & <% = SMTP_SSL %>)))
  284.         {
  285.             if(uform.txtRouteDomain.value != "")
  286.             {
  287.                 if (checkSpaces(uform.hdnRouteDomain) == true)
  288.                 {
  289.                     uform.hdnRouteDomain.value = escape(uform.txtRouteDomain.value);
  290.                 }
  291.                 else
  292.                 {
  293.                     return false;
  294.                 }
  295.             }
  296.             uform.newActionType.value = uform.newActionType.value | <% = SMTP_SMARTHOST %>;
  297.             return true;
  298.         }
  299.         else if((uform.rdoDomainLocal[1].checked) && (uform.newActionType.value & <% = SMTP_SSL %>))
  300.         {
  301.             if(uform.txtRouteDomain.value != "")
  302.             {
  303.                 if (checkSpaces(uform.hdnRouteDomain) == true)
  304.                 {
  305.                     uform.hdnRouteDomain.value = escape(uform.txtRouteDomain.value);
  306.                 }
  307.                 else
  308.                 {
  309.                     return false;
  310.                 }
  311.             }
  312.             uform.newActionType.value = uform.newActionType.value | <%= SMTP_SSL %>;
  313.             return true;
  314.         }
  315.         else if((uform.rdoDomainLocal[0].checked) && (uform.rdoDomainType[1].checked))
  316.         {
  317.             if(uform.txtDropDir.value != "")
  318.             {
  319.                 uform.newDropDir.value = escape(uform.txtDropDir.value);
  320.             }
  321.             
  322.             uform.newActionType.value = uform.newActionType.value | <%= SMTP_ALIAS %>;
  323.             return true;
  324.         }
  325.  
  326.         else
  327.         {
  328.             alert("<%= L_CHOOSE_DOMAIN_TYPE_TEXT %>");
  329.             return false;
  330.         }
  331.     }
  332.     else
  333.     {
  334.         alert("<%= L_ENTER_DOMAIN_NAME_TEXT %>")
  335.         uform.txtDomainName.focus();
  336.         return false;
  337.     }
  338.  
  339. }
  340.  
  341. function txtTochk(thisControl)
  342. {
  343.     if(thisControl.value == "")
  344.     {
  345.         return false;
  346.     }
  347.     else if(thisControl.value == "0")
  348.     {
  349.         return false;
  350.     }
  351.     else 
  352.     {
  353.         return true;
  354.     }
  355. }
  356.                 
  357.  
  358. function chkToTxt(chkControl) 
  359. {
  360.     if (chkControl.checked) 
  361.     {
  362.         return "1";
  363.     }
  364.     else 
  365.     {
  366.         return "0";
  367.     }
  368. }
  369.  
  370. <% REM Javascript function maintainTxt %>
  371.  
  372.     function maintainTxt() 
  373.     {
  374.  
  375.         if (isFull(document.userform.txtDomainName.value)) 
  376.         {
  377.             document.userform.newDomainName.value = document.userform.txtDomainName.value;
  378.         }
  379.     }
  380.  
  381.  
  382. <% REM Javascript function helpBox %>
  383.  
  384.     function helpBox() 
  385.     {
  386.         window.open("help/smdomedh.htm","Help","toolbar=no,scrollbars=yes,directories=no,menubar=no,width=450,height=450");
  387.     }
  388.     
  389. <% REM Javascript function chkChar %>
  390.         
  391. function chkChar(txtfield) 
  392. {
  393.     txtvalue = txtfield.value
  394.     i = (txtvalue.indexOf("'") + txtvalue.indexOf('"'));
  395.     i = (i + txtvalue.indexOf("<") + txtvalue.indexOf('>') + txtvalue.indexOf('%'));
  396.     i = (i + txtvalue.indexOf("&") + txtvalue.indexOf("#") + txtvalue.indexOf("("));
  397.     i = (i + txtvalue.indexOf("+") + txtvalue.indexOf(")") + txtvalue.indexOf("@"));
  398.     i = (i + txtvalue.indexOf("~") + txtvalue.indexOf("`") + txtvalue.indexOf("!"));
  399.     i = (i + txtvalue.indexOf("^") + txtvalue.indexOf("*") + txtvalue.indexOf("="));
  400.     i = (i + txtvalue.indexOf("|") + txtvalue.indexOf(";"));
  401.     i = (i + txtvalue.indexOf(",") + txtvalue.indexOf("?"));
  402.     if (i != -21) 
  403.     {
  404.         alert("<%= L_PATH_SYNTAX_INCORR_TEXT %>");
  405.         document.userform.txtfield.value = "";
  406.         document.userform.txtfield.focus();
  407.         return false; 
  408.     }
  409.     else 
  410.     {
  411.         return true;
  412.     }
  413. }
  414.                     
  415.  
  416. function saveRoute()
  417. {
  418.     uform = document.userform;
  419.     if(uform.txtRouteDomain.value != "")
  420.     {
  421.         uform.newRouteDomain.value = uform.txtRouteDomain.value;
  422.     }
  423. }
  424.  
  425. function saveDrop()
  426. {
  427.     uform = document.userform;
  428.     if(uform.txtDropDir.value != "")
  429.     {
  430.         uform.newRouteDomain.value = uform.txtDropDir.value;
  431.     }
  432. }
  433.  
  434. function clearField(pControl)
  435. {
  436.     uform = document.userform;
  437.     pControl.value = uform.blank.value;
  438. }
  439. <% REM Initialize function reads values from object and plugs them  into the controls on the form %>
  440.  
  441. function Initialize()
  442. {
  443.         uform = document.userform;
  444. <% if ((a <> "add") AND (a <> "save")) then %>
  445.  
  446. <% On Error Resume Next %>
  447. <% firstDomain = szDomains(0) %>
  448. <% if (Err <> 0) then
  449.     szError = GetErrorMessage(Err) %>
  450.     alert("<% = szError %>");
  451. <% end if %>
  452. <% szRouteDomain = "" %>        
  453. <%        if(a <> "add") then
  454.             if (DomainIndex <> 1) then
  455.                 On Error Resume Next
  456.                 set thisDom = GetObject(szDomainString & "/" & szDomains(DomainIndex - 1))
  457.                 if (Err <> 0) then
  458.                     szError = GetErrorMessage(Err) %>
  459.                     alert("<% = szError %>");
  460. <%                end if 
  461.             end if
  462.         end if
  463.         szRouteDomain = thisDom.RouteActionString
  464.         if (DomainIndex <> 1) then
  465.             actionType = thisDom.RouteAction
  466.             szRouteDomain    = thisDom.RouteActionString
  467.         else
  468.             actionType = SMTP_DEFAULT
  469.             szRouteDomain = VServer.DropDirectory
  470.         end if
  471.     
  472.         if (InStr(szRouteDomain, "\\") = 0) then
  473.             szRouteDomain = Replace(szRouteDomain, "\", "\\")
  474.         end if
  475.         DropDirectory = VServer.DropDirectory
  476.         if (InStr(DropDirectory, "\\") = 0) then
  477.             szDropDirectory = Replace(DropDirectory, "\", "\\")
  478.         end if
  479.  
  480.         RouteDomain = szRouteDomain
  481.  
  482.         DomainName = szDomains(DomainIndex - 1)
  483.         if (a <> "new") then
  484.             icomp        = 0
  485.             icomp = actionType And SMTP_DROP
  486.             if (icomp) then %>
  487.                 uform.rdoDomainLocal[0].checked = true;
  488.                 uform.rdoDomainType[1].checked = true;
  489.                 uform.txtDropDir.value = "<% = szDropDirectory %>";
  490.                 uform.hdnDropDir.value = "<% = szDropDirectory %>";
  491.                 uform.hdnRouteDomain.value = "";
  492. <%            end if
  493.             
  494.             icomp    = 0
  495.             icomp = actionType And SMTP_SMARTHOST
  496.             if (icomp) then %>
  497.                 uform.rdoDomainLocal[1].checked = true;
  498.                 uform.txtRouteDomain.value = "<% = szRouteDomain %>";
  499.                 uform.hdnRouteDomain.value = "<% = szRouteDomain %>";
  500.                 uform.txtDropDir.value = "";
  501.                 uform.hdnDropDir.value = "<% = szDropDirectory %>";
  502. <%            end if 
  503.  
  504.             icomp = 0
  505.             icomp = actionType And SMTP_SSL
  506.             if (icomp) then %>
  507.                 uform.rdoDomainLocal[1].checked = true;
  508.                 uform.txtRouteDomain.value = "<% = szRouteDomain %>";
  509.                 uform.hdnRouteDomain.value = "<% = szRouteDomain %>";
  510.                 uform.txtDropDir.value = "";
  511.                 uform.hdnDropDir.value = "<% = szDropDirectory %>";
  512. <%            end if
  513.  
  514.             icomp = 0
  515.             icomp = actionType And SMTP_ALIAS
  516.             if (icomp) then %>
  517.                 uform.rdoDomainLocal[0].checked = true;
  518.                 uform.rdoDomainType[1].checked = true;
  519.                 uform.txtDropDir.value = "<% = szDropDirectory %>";
  520.                 uform.hdnDropDir.value = "<% = szDropDirectory %>";
  521.                 uform.hdnRouteDomain.value = "";
  522.                 uform.txtRouteDomain.value = "";
  523. <%            end if
  524.  
  525.             icomp = 0
  526.             icomp = actionType And SMTP_DELIVER 
  527.             if (icomp) then %>
  528.                 uform.rdoDomainLocal[0].checked = true;
  529.                 uform.rdoDomainType[1].checked = true;
  530.                 uform.txtDropDir.value = "<% = szDropDirectory %>";
  531.                 uform.hdnDropDir.value = "<% = szDropDirectory %>";
  532.                 uform.hdnRouteDomain.value = "";
  533.                 uform.txtRouteDomain.value = "";
  534. <%            end if
  535.  
  536.             icomp = 0
  537.             icomp = actionType and SMTP_DEFAULT
  538.             if (icomp) then %>
  539.                 uform.rdoDomainLocal[0].checked = true;
  540.                 uform.rdoDomainType[0].checked = true;
  541.                 uform.txtDropDir.value = "<% = szDropDirectory %>";
  542.                 uform.hdnDropDir.value = "<% = szDropDirectory %>";
  543.                 uform.hdnRouteDomain.value = "";
  544.                 uform.txtRouteDomain.value = "";
  545. <%            end if 
  546.  
  547.             icomp = 0
  548.             icomp = actionType and SMTP_DOMAIN_RELAY
  549.             if (icomp) then %>
  550.                 uform.chkAllowRelay.checked = true;
  551. <%            end if
  552.         end if %>
  553.         uform.txtDomainName.value = "<% = DomainName %>";
  554.         uform.hdnDomainName.value = "<% = DomainName %>";
  555. <% end if %>
  556.  
  557. <% if (a = "new") then %>
  558.     <% szRouteDomain = VServer.DropDirectory %>
  559. <%    
  560.     if (InStr(szRouteDomain, "\\") = 0) then
  561.         szRouteDomain = Replace(szRouteDomain, "\", "\\")
  562.     end if %>
  563.  
  564.     uform.txtDomainName.value = "";
  565.     uform.rdoDomainLocal[0].checked = true;
  566.     uform.rdoDomainType[1].checked = true;
  567.     uform.newActionType.value = "<% = SMTP_ALIAS %>";
  568.     uform.hdnRouteDomain.value = "";
  569.     uform.txtDropDir.value = "<% = szDropDirectory %>";
  570.     uform.hdnDropDir.value = "<% = szDropDirectory %>";
  571.     uform.chkAllowRelay.checked = false;
  572.     <% ActionType = SMTP_ALIAS %>
  573. <% end if %>
  574. <% DomainName = Request("txtDomainName") %>
  575. }
  576.  
  577.  
  578. function checktype()
  579. {
  580.     
  581.     uform = document.userform;
  582.     var iActionType = uform.newActionType.value;
  583.     //now we check to see if this domain type is legal
  584.     //if the current domain is the default and the user tries to change it we check to see if it's legal
  585.     if (<% = ActionType %> & <% = SMTP_DEFAULT %>)
  586.     {
  587.     //if the default domain is not checked then check to see if the current domain is the default domain
  588.     // if so set it back and popup an error message
  589.         if(!(uform.rdoDomainType[0].checked))
  590.         {
  591.                 alert("<% = L_ONLYDEFAULT_TEXT %>");
  592.                 //uform.rdoDomainType[1].checked = false;
  593.                 uform.rdoDomainType[0].checked = true;
  594.                 uform.rdoDomainLocal[0].checked = true;
  595.                 
  596.         }
  597.     }
  598.     else if(iActionType & <% = SMTP_ALIAS %>)
  599.     {
  600.         if(uform.rdoDomainType[0].checked)
  601.         {
  602. <%            if (a = "new") then %>
  603.             alert("<% = L_NEWERROR_ERRORMESSAGE %>")
  604.             //uform.rdoDomainLocal[1].checked = false;
  605.             //uform.rdoDomainType[0].checked = false;
  606.             uform.rdoDomainLocal[0].checked = true;
  607.             uform.rdoDomainType[1].checked = true;
  608.             
  609.             return;
  610. <%            else %>
  611.             if(<% = iNumOfDomains %> <= 1)
  612.             {
  613.                 alert("<% = L_ONLYDEFAULT_TEXT %>");
  614.                 uform.rdoDomainLocal[1].checked = false;
  615.                 uform.rdoDomainType[0].checked = false;
  616.                 uform.rdoDomainLocal[0].checked = true;
  617.                 uform.rdoDomainType[1].checked = true;
  618.             }
  619. <%            end if %>
  620.         }
  621.     }
  622. }
  623.  
  624. function checkLocal()
  625. {
  626.     uform = document.userform;
  627. <%    icomp = 0
  628.     icomp = actionType and SMTP_DEFAULT
  629.     if (icomp = 0) then %>
  630.     uform.rdoDomainLocal[1].checked = false;
  631. <% end if %>
  632.     uform.rdoDomainType[0].checked = false;
  633.     uform.rdoDomainLocal[0].checked = true;
  634.     uform.rdoDomainType[1].checked = true;
  635.     uform.txtDropDir.value = uform.hdnDropDir.value;
  636.     uform.txtRouteDomain.value = "";
  637. }
  638.  
  639. function checkRemote()
  640. {
  641.     uform = document.userform;
  642.     uform.rdoDomainLocal[0].checked = false;
  643.     uform.rdoDomainType[0].checked = false;
  644.     uform.rdoDomainType[1].checked = false;
  645.     uform.rdoDomainLocal[1].checked = true;
  646.     uform.txtRouteDomain.value = uform.hdnRouteDomain.value;
  647.     uform.txtDropDir.value = "";
  648.  
  649. }
  650.  
  651. function checkDefault()
  652. {
  653.     uform = document.userform;
  654. <%    icomp = 0
  655.     icomp = actionType and SMTP_DEFAULT
  656.     if (icomp = 0) then %>
  657.         uform.rdoDomainLocal[1].checked = false;
  658. <%    end if %>
  659.     uform.rdoDomainType[1].checked = false;
  660.     uform.rdoDomainLocal[0].checked = true;
  661.     uform.rdoDomainType[0].checked = true;
  662.     uform.txtDropDir.value = uform.hdnDropDir.value;
  663.     uform.txtRouteDomain.value = "";
  664.  
  665.  
  666.  
  667. }
  668.  
  669. function checkAlias()
  670. {
  671.     uform = document.userform;
  672. <%    icomp = 0
  673.     icomp = actionType and SMTP_DEFAULT
  674.     if (icomp = 0) then %>
  675.     uform.rdoDomainLocal[1].checked = false;
  676. <% end if %>
  677.     uform.rdoDomainType[0].checked = false;
  678.     uform.rdoDomainType[1].checked = true;
  679.     uform.rdoDomainLocal[0].checked = true;
  680.     uform.txtDropDir.value = uform.hdnDropDir.value;
  681.     uform.txtRouteDomain.value = "";
  682.  
  683.  
  684. }
  685.  
  686. function checkSpaces(txtControl)
  687. {
  688.     uform = document.userform;
  689.     var myString = new String(txtControl.value);
  690.     if((myString.indexOf(" ")) < 0)
  691.     {
  692.         return true;
  693.     }
  694.     else
  695.     {
  696.         alert("<% = L_INVALID_DOMAIN_NAME_ERRORMESSAGE %>");
  697.         uform.txtRouteDomain.focus();
  698.         return false;
  699.     }
  700. }
  701.  
  702.  
  703. function openOutboundSec()
  704. {
  705. <% if (a <> "new") then %>
  706.     var width = 450;
  707.     var height = 330;
  708.     
  709.     <% if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then %>
  710.     <% else %>
  711.         width = width +25;
  712.         height = height + 50;
  713.     <% end if %>
  714.  
  715.     uform = document.userform;
  716.     var path = "smosec.asp?svr=<% = svr %>&ServerInstance=<% = ServerInstance %>&secType=<% = DOMAINS_TEXT %>&DomainName=" + uform.txtDomainName.value;
  717.     var popbox = window.open(path,"<% = L_OUTBOUND_SECURITY_TITLE_TEXT %>","toolbar=no,scrollbars=no,directories=no,menubar=no,width="+width+",height="+height+",resizable=no");
  718.     if(popbox !=null)
  719.     {
  720.         if (popbox.opener == null)
  721.         {
  722.             popbox.opener = self;
  723.         }
  724.     }
  725. <% else %>
  726.     alert("<% = L_NEW_DOMAIN_SEC_TEXT %>");
  727. <% end if %>
  728. }
  729.                 
  730. function flipAllow(chkControl)
  731. {
  732.     uform = document.userform;
  733.     if(chkControl != null)
  734.     {
  735.         var iActionBits = uform.newActionType.value;
  736.         if(chkControl.checked)
  737.         {
  738.             iActionBits = iActionBits | <% = SMTP_DOMAIN_RELAY %>;
  739.         }
  740.         else
  741.         {
  742.             iActionBits = iActionBits & ~<% = SMTP_DOMAIN_RELAY %>;
  743.         }
  744.  
  745.         uform.newActionType.value = iActionBits;
  746.     }
  747. }
  748.     
  749.     
  750. function saveRouteActionString(txtControl)
  751. {
  752.     uform = document.userform;
  753.  
  754.     if(txtControl.name == "txtDropDir")
  755.     {
  756. <%        icomp = 0
  757.         icomp = actionType And SMTP_DEFAULT
  758.         if (icomp = 0) then %>
  759.         uform.txtDropDir.value = uform.hdnDropDir.value;
  760. <%        else %>
  761.         uform.hdnDropDir.value = uform.txtDropDir.value;
  762. <%        end if %>
  763.  
  764.     }
  765.     else
  766.     {
  767.         uform.hdnRouteDomain.value = uform.txtRouteDomain.value;
  768.     }
  769. }
  770.  
  771. function checkName(txtControl)                    
  772. {
  773.     uform = document.userform;
  774. <%    if (a = "edit") then %>
  775.     uform.txtDomainName.value = uform.hdnDomainName.value;
  776. <%    end if %>
  777. }
  778. </SCRIPT>
  779. <TITLE>
  780. <% if (a = "edit") then %>
  781.     <%= L_EDITDOMPROP_TEXT %>
  782. <% elseif (a = "new") then %>
  783.     <%= L_ADDDOMAIN_TEXT %>
  784. <% end if %>
  785. </TITLE>
  786.  
  787.  
  788. </HEAD>
  789.  
  790. <BODY background="images\black.gif" BGCOLOR="#CCCCCC" TEXT="#000000" TOPMARGIN=15 LINK="#000000" VLINK="#000000" ALINK="#000000">
  791. <script language="javascript">
  792. <% if ((a = "add") OR (a = "save")) then %>
  793.  
  794.     <% ActionType = Request("newActionType") %>
  795. <%    icomp = 0
  796.     icomp = (ActionType And SMTP_DEFAULT)
  797.     if (icomp <> 0) then
  798.         RouteDomain = Cstr(Request("hdnDropDir"))
  799.     elseif (ActionType And SMTP_ALIAS) then
  800.         RouteDomain = VServer.DropDirectory
  801.     else
  802.         RouteDomain = Cstr(Request("hdnRouteDomain"))
  803.     end if
  804.  
  805.     if (ActionType And SMTP_ALIAS) then
  806.         RouteDomain = VServer.DropDirectory
  807.     end if
  808.  %>
  809.     <% RouteDomain = Replace(RouteDomain,"%5C","\") %>
  810.     <% RouteDomain = Replace(RouteDomain,"%3A",":") %>
  811.     <% RouteDomain = Replace(RouteDomain, "\", "\\") 
  812.     if (InStr(RouteDomain, "\\") <> 0) then
  813.         RouteDomain = Replace(RouteDomain, "\\", "\")
  814.     end if %>
  815.  
  816.  
  817.     <% originalDomain = Request("hdnOrigDomainName") %>
  818.     <% DomainName = Request("txtDomainName") %>
  819.     <% ActionType = CInt(ActionType) %>
  820.  
  821. <%    if (a = "add") then %>
  822.         <% On Error Resume Next %>    
  823.         <% set thisDomain = smtpDomain.Create(szDomainClassString, DomainName) %>
  824.         <% if (Err <> 0) then
  825.             szError = GetErrorMessage(Err) %>
  826.             alert("<% = szError %>");
  827. <%        end if %>
  828.  
  829.         <% thisDomain.SetInfo %>
  830.         <% thisDomain.RouteAction = ActionType %>
  831.         <% if (Err <> 0) then
  832.             szError = GetErrorMessage(Err) %>
  833.             alert("<% = szError %>");
  834. <%        end if %>
  835.     
  836. <%        if (InStr(RouteDomain, "\\") <> 0) then
  837.             RouteDomain = Replace(RouteDomain, "\\", "\")
  838.         end if %>
  839.         <% thisDomain.RouteActionString = RouteDomain %>
  840.  
  841.         <% if ((ActionType And SMTP_SMARTHOST) or (ActionType And SMTP_SSL)) then %>
  842.         <%    thisDomain.RouteActionString = RouteDomain %>
  843.         <% end if %>
  844.  
  845. <%        if ((ActionType And SMTP_SMARTHOST) or (ActionType And SMTP_SSL)) then
  846.             thisDomain.RouteActionString = RouteDomain
  847.         else
  848.             if (InStr(RouteDomain, "\\") <> 0) then
  849.                 RouteDomain = Replace(RouteDomain, "\\", "\")
  850.             end if 
  851.             thisDomain.RouteActionString = RouteDomain
  852.         end if
  853.  
  854.         On Error Resume Next
  855.         thisDomain.SetInfo
  856.         if (Err <> 0) then
  857.             szError = GetErrorMessage(Err) %>
  858.             alert("<% = szError %><% = Err %>");
  859. <%        end if %>
  860.  
  861. <%        On Error Resume Next
  862.         VServer.SetInfo
  863.         if (Err <> 0) then
  864.             szError = GetErrorMessage(Err) %>
  865.             alert("<% = szError %><% = Err %> : 678");
  866. <%        end if %>
  867.     
  868. <%    elseif (a = "save") then %>
  869. <%        if ((DomainName = VServer.DefaultDomain) And (ActionType And SMTP_DEFAULT)) then
  870.             VServer.DropDirectory = RouteDomain
  871.  
  872.             On Error Resume Next
  873.             VServer.SetInfo
  874.             if (Err <> 0) then
  875.                 szError = GetErrorMessage(Err) %>
  876.                 alert("<% = szError %><% = Err %>");
  877. <%            end if %>
  878. <%        else %>
  879.  
  880. <%            if (originalDomain <> DomainName) then %>
  881.                    <% REM Create a new domain to copy new values into %>
  882.                 <% On Error Resume Next %>
  883.                 <% set oldDomain = GetObject(szDomainString & "/" & originalDomain) %>
  884.                 <% if (Err <> 0) then %>
  885. <%                    szError = GetErrorMessage(Err) %>
  886.                     alert("<% = szError %>");
  887.               <% end if %>
  888.  
  889.                 <% On Error Resume Next %>
  890.                 <% smtpDomain.Delete szDomainClassString, originalDomain %>
  891.                 <% if (Err <> 0) then %>
  892. <%                    szError = GetErrorMessage(Err) %>
  893.                     alert("<% = szError %>");
  894.                 <% end if %>
  895.  
  896. <%                On Error Resume Next
  897.                 set thisDomain = smtpDomain.Create(szDomainClassString, DomainName) %>
  898. <%                if (Err <> 0) then %>
  899. <%                    szError = GetErrorMessage(Err) %>
  900.                     alert("<% = szError %>");
  901.                 <% end if
  902.  
  903.                 thisDomain.RouteAction = ActionType %>
  904.  
  905. <%                if (InStr(RouteDomain, "\\") <> 0) then
  906.                     RouteDomain = Replace(RouteDomain, "\\", "\")
  907.                 end if 
  908.  
  909.                 if ((ActionType And SMTP_SMARTHOST) or (ActionType And SMTP_SSL)) then
  910.                     thisDomain.RouteActionString =RouteDomain
  911.                 else
  912.                     
  913.                     thisDomain.RouteActionString = RouteDomain
  914.                 end if
  915.  
  916.                 On Error Resume Next
  917.                 thisDomain.SetInfo
  918.                 if (Err <> 0) then
  919.                     szError = GetErrorMessage(Err) %>
  920.                     alert("<% = szError %>");
  921. <%                end if
  922. %>
  923.  
  924. <%                if (ActionType And SMTP_DEFAULT) then
  925.                     REM call function to change Default Domain
  926.                     ChangeDefaultDomain DomainName
  927.                 end if
  928.  
  929.                 On Error Resume Next
  930.                 VServer.SetInfo
  931.                 if (Err <> 0) then %>
  932. <%                    szError = GetErrorMessage(Err) %>
  933.                     alert("<% = szError %>");
  934.                    <% end if %>
  935.  
  936.             <% end if %>
  937.  
  938.  
  939. <%            On Error Resume Next
  940.             set thisDomain = GetObject(szDomainString & "/" &  DomainName) %>
  941. <%            if (Err <> 0) then %>
  942. <%                szError = GetErrorMessage(Err) %>
  943.                 alert("<% = szError %>");
  944.                 alert("<% = szDomainString %>/<% = DomainName %>");
  945.             <% end if
  946.  
  947.             thisDomain.RouteAction = ActionType %>
  948.  
  949. <%            if (InStr(RouteDomain, "\\") <> 0) then
  950.                 RouteDomain = Replace(RouteDomain, "\\", "\")
  951.             end if 
  952. %>
  953. <%            if ((ActionType And SMTP_SMARTHOST) or (ActionType And SMTP_SSL)) then
  954.                 thisDomain.RouteActionString = RouteDomain
  955.             else
  956.                 
  957.                 thisDomain.RouteActionString = RouteDomain
  958.             end if
  959.  
  960.             On Error Resume Next
  961.             thisDomain.SetInfo
  962.             if (Err <> 0) then  %>
  963. <%                szError = GetErrorMessage(Err) %>
  964.                 alert("<% = szError %>");
  965. <%            end if
  966.  
  967.             if (ActionType And SMTP_DEFAULT) then
  968.                 REM call function to change Default Domain
  969.                 ChangeDefaultDomain DomainName
  970.             end if
  971.  
  972.  
  973.             On Error Resume Next
  974.             VServer.SetInfo
  975.             if (Err <> 0) then %>
  976. <%                szError = GetErrorMessage(Err) %>
  977.                 alert("<% = szError %>");
  978.                <% end if %>
  979.     
  980.         <% end if %>
  981. <%    end if %>        
  982.         opener.location = "smdomhd.asp?svr=<% = svr %>&SelectedDom=<% = thisDomain.DomainName %>";
  983.           self.close();
  984.  
  985. <% end if %>
  986.  
  987.  
  988.  
  989. <% 
  990. if (a = "new") then
  991.         
  992.     DomainName = "corp.com"
  993.     RouteDomain = VServer.DropDirectory
  994.     szRouteDomain = VSserver.DropDirectory
  995.     actionType = SMTP_ALIAS
  996.  
  997. elseif (a = "edit") then
  998.  
  999.     REM Get a pointer to the VirtualDomain Object we are editing
  1000.     if (szDomains(DomainIndex - 1) <> VServer.DefaultDomain) then
  1001.         On Error Resume Next
  1002.         set thisDomain = GetObject(szDomainString & "/" & szDomains(DomainIndex - 1))
  1003.         if (Err <> 0) then %>
  1004. <%            szError = GetErrorMessage(Err) %>
  1005.             alert("<% = szError %>");
  1006. <%        end if
  1007.         actionType = thisDomain.RouteAction 
  1008.         ActionType = thisDomain.RouteAction 
  1009.         RouteDomain = thisDomain.RouteActionString
  1010.         DomainName = thisDomain.Name %>
  1011. <%    else
  1012.         thisDomain = VServer.DefaultDomain
  1013.         DomainName = thisDomain
  1014.         RouteDomain = VServer.DropDirectory
  1015.         actionType = SMTP_DEFAULT
  1016.         ActionType = SMTP_DEFAULT
  1017.     end if
  1018.  
  1019. end if %>
  1020. </SCRIPT>
  1021.  
  1022. <FORM NAME="userform" ACTION="smdomed.asp"  METHOD="post" onSubmit="return GetActionType();">
  1023.  
  1024. <INPUT TYPE="hidden" NAME="svr"         VALUE="<% = svr %>">
  1025. <INPUT TYPE="hidden" NAME="a"           VALUE="">
  1026. <INPUT TYPE="hidden" NAME="hdnDropDir"  VALUE="<% = RouteDomain %>">
  1027. <INPUT TYPE="hidden" NAME="DirHome"     VALUE="<% = DirHome %>">
  1028. <INPUT TYPE="hidden" NAME="index"       VALUE="<% = DomainIndex %>">
  1029. <INPUT TYPE="hidden" NAME="hdnRouteDomain" VALUE="<% = RouteDomain %>">
  1030. <INPUT TYPE="hidden" NAME="hdnOrigDomainName" VALUE="<% = DomainName %>">
  1031. <INPUT TYPE="hidden" NAME="newDropDir" VALUE="">
  1032. <INPUT TYPE="hidden" NAME="newDomainName" VALUE="">
  1033. <INPUT TYPE="hidden" NAME="newActionType" VALUE="<% = actionType %>">
  1034. <INPUT TYPE="hidden" NAME="newRouteDomain" VALUE="<% = RouteDomain %>">
  1035. <input type="hidden" name="ServiceInstance" value="<% = ServerInstance %>">
  1036. <input type="hidden" name="hdnDomainName" value="<% = DomainName %>">
  1037.  
  1038. <INPUT TYPE="hidden" NAME="blank" VALUE="">
  1039.  
  1040. <TABLE BORDER="1" BGCOLOR="#CCCCCC" WIDTH="100%" cellpadding="10">
  1041.  
  1042. <TR><TD>
  1043. <P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B>
  1044. <% if (a = "edit") then %>
  1045.     <% = L_EDITDOMAIN_TEXT%>
  1046. <% elseif (a = "new") then %>
  1047.      <%= L_ADD_DOMAIN_ON_TEXT %>
  1048. <% end if %>
  1049. </B></FONT><FONT FACE="Times New Roman" SIZE=3><I><% = svr %></I></FONT>
  1050.     <TABLE BORDER="0" WIDTH="100%">
  1051.         <TR>
  1052.             <TD align="left" colspan="2">
  1053.                 <table border="0" width="100%">
  1054.                 <tr><td>
  1055.                     <FONT FACE="Arial" SIZE=2>
  1056.                     <B><%= L_DOMAINNAME_TEXT%></B>
  1057.                     </font>
  1058.                 </td><td>
  1059.                     <% if (actionType = SMTP_DEFAULT) then %>
  1060.                     <input name="txtDomainName" type="hidden" VALUE="<% = DomainName %>">
  1061.                     <table border="1">
  1062.                         <tr><td bgcolor="#cdcdcd">
  1063.                             <font face="Arial" size="2">
  1064.                                <% = DomainName %>   
  1065.                             </font>
  1066.                         </td></tr>
  1067.                     </table>
  1068.                     <% else %>
  1069.                         <INPUT NAME="txtDomainName" TYPE="text" SIZE=25 OnBlur="checkName(this);checkLength(this);maintainTxt();" onChange="maintainTxt();" VALUE="">
  1070.                     <% end if %>
  1071.                 </td></tr>
  1072.                 </table>
  1073.             </FONT>
  1074.         <TR><TD colspan="2">
  1075.              
  1076.         </TD></TR>
  1077.         <TR><TD>
  1078.             <table border=0 width="100%">
  1079.                 <tr>
  1080.                     <td colspan="2">
  1081.                         <FONT FACE="Arial" SIZE=2>
  1082.                         <INPUT NAME="rdoDomainLocal" TYPE="radio" VALUE="Local Domain" OnClick="checkLocal();checktype();"><% = L_LOCALDOMAIN_TEXT %>
  1083.                         </font>
  1084.                     </td>
  1085.                 </tr><tr>
  1086.                     <td colspan="2">
  1087.                     <table border="1" width="100%">
  1088.                     <tr><td>
  1089.                         <table border="0" width="100%">
  1090.                         <tr><td>
  1091.                              
  1092.                         </td><td colspan="2">
  1093.                             <font face="Arial" size="2">
  1094.                             <INPUT NAME="rdoDomainType" TYPE="radio" VALUE="Default Local" OnClick="checkDefault();checktype();">
  1095.                             <% = L_DEFAULTLOCAL_TEXT %>
  1096.                             </font>
  1097.                         </td></tr>
  1098.                         <tr><td>
  1099.                              
  1100.                         </td><td colspan="2">
  1101.                             <FONT FACE="Arial" SIZE=2>
  1102.                             <INPUT NAME="rdoDomainType" TYPE="radio" VALUE="Alias Local" OnClick="checkAlias();checktype();">
  1103.                             <% = L_ALIASLOCAL_TEXT %>
  1104.                             </font>
  1105.                         </td></tr>
  1106.                         <tr><td>
  1107.                              
  1108.                         </td><td>
  1109.                             <FONT FACE="Arial" SIZE=2>
  1110.                             <B><% = L_DROPDIR_TEXT %></B>
  1111.                             </font>
  1112.                         </td><td>
  1113.                             <INPUT NAME="txtDropDir" TYPE="text" VALUE="<% = RouteDomain %>" OnBlur="checkLength(this);chkChar(this);saveRouteActionString(this);" OnChange="saveRouteActionString(this);">
  1114.                         </td></tr>
  1115.                         <tr><td>
  1116.                              
  1117.                         </td></tr>
  1118.                         </table>
  1119.                     </td></tr>
  1120.                     </table>
  1121.             </td></tr>
  1122.             </table>
  1123.         </TD></TR>
  1124.         <% if (actionType <> SMTP_DEFAULT) then %>
  1125.         <TR>
  1126.             <TD>
  1127.                  
  1128.         </TD></TR>
  1129.         <TR><TD colspan="2">
  1130.             <FONT FACE="Arial" SIZE=2>
  1131.             <INPUT NAME="rdoDomainLocal" TYPE="radio" VALUE="Remote Domain" OnClick="checkRemote();checktype(this);"><% = L_REMOTEDOMAIN_TEXT %>
  1132.             </font>
  1133.         </TD></TR>
  1134.         <TR><TD colspan="2">
  1135.             <table border=1 width=100%>    
  1136.             <tr><td>    
  1137.                 <table border=0 width=100%>
  1138.                     <tr><td>
  1139.                         <FONT FACE="Arial" SIZE=2>
  1140.                         <b><% = L_ROUTE_TEXT %></b>
  1141.                         </font>
  1142.                     </td><td>
  1143.                         <INPUT NAME="txtRouteDomain" TYPE="text" VALUE="" OnBlur="checkLength(this);saveRouteActionString(this);" OnChange="saveRouteActionString(this);">
  1144.                     </td></tr>
  1145.                     <tr><td colspan="2" Height="4">
  1146.                          
  1147.                     </td></tr>
  1148.                     <tr><td colspan="2">
  1149.                         <FONT SIZE=2 FACE="Arial">
  1150.                         <input name="chkAllowRelay" type="checkbox" value="">
  1151.                          <% = L_ALLOW_INCOMING_RELAY_TEXT %>
  1152.                         </font>
  1153.                     </td></tr>
  1154.                     <tr><td>
  1155.                          
  1156.                     </td></tr>
  1157.                     <tr><td>
  1158.                         <FONT SIZE=2 FACE="Arial">
  1159.                         <input name="btnOutboundSec" type="button" value="<% = L_OUTBOUNDSECURITY_TEXT %>" size="20" OnClick="openOutboundSec();">
  1160.                         </font>
  1161.                     </td></tr>
  1162.                 </table>
  1163.             </td></tr>
  1164.             </table>
  1165.     <% else %>
  1166.         <TR><TD>
  1167.         <INPUT NAME="rdoDomainLocal" TYPE="hidden" VALUE=""> 
  1168.         <INPUT NAME="txtRouteDomain" TYPE="hidden" VALUE="">
  1169.     <% end if %>
  1170.  
  1171.         </TD></TR>
  1172.             <tr>
  1173.         <td colspan="2" Height="4">
  1174.              
  1175.         </td>
  1176.     </tr>
  1177.  
  1178.     </TABLE>
  1179. </TD></TR>
  1180. </TABLE>
  1181.  
  1182. <script language="javascript">
  1183.     Initialize();
  1184. <%    
  1185.     if (actionType = SMTP_DEFAULT) then %>
  1186.         document.userform.txtDropDir.focus();
  1187.     <% else %>
  1188.         document.userform.txtDomainName.focus();
  1189.     <% end if %>
  1190. </script>
  1191. <% end if %>
  1192. <P>
  1193. <TABLE ALIGN="right" BORDER=0 CELLPADDING=2 CELLSPACING=2>
  1194.  
  1195. <TR>
  1196.     <TD>
  1197.     <TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
  1198.         <TR>
  1199.             <TD VALIGN="middle">
  1200.                 <FONT FACE="Arial" SIZE=2>
  1201.                 <B><A HREF="javascript:onOK();">
  1202.                 <IMG SRC="images/gnicok.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
  1203.                 <A HREF="javascript:onOK();"><% = L_OK_TEXT%></A></B>
  1204.                 </FONT>
  1205.             </TD>    
  1206.         </TR>
  1207.         
  1208.     </TABLE>
  1209.     </TD>
  1210.  
  1211.     <TD>
  1212.     <TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
  1213.         <TR>
  1214.             <TD VALIGN="middle">
  1215.                 <FONT FACE="Arial" SIZE=2>
  1216.                 <B><A HREF="javascript:close();">
  1217.                 <IMG SRC="images/gniccncl.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
  1218.                 <A HREF="javascript:close();"><% = L_CANCEL_TEXT %></A></B>
  1219.                 </FONT>
  1220.             </TD>    
  1221.         </TR>
  1222.     </TABLE>
  1223.     </TD>
  1224.     
  1225.     <TD>
  1226.     <TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
  1227.         <TR>
  1228.             <TD VALIGN="middle">
  1229.                 <FONT FACE="Arial" SIZE=2><A HREF="javascript:helpBox();">
  1230.                 <IMG SRC="images/gnichelp.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
  1231.                 <B><A HREF="javascript:helpBox();"><% = L_HELP_TEXT %></A></B>
  1232.                 </FONT>
  1233.             </TD>    
  1234.         </TR>
  1235.     </TABLE>
  1236.     </TD>
  1237.     
  1238.     <TD> </TD>
  1239. </TR>
  1240. </TABLE>
  1241.  
  1242. </FORM>
  1243.     
  1244. </BODY>
  1245. </HTML>
  1246.  
  1247. <%
  1248. '---------------------------------------------------------------------------------------
  1249. '
  1250. '    Function ChangeDefaultDomain(szNewDefaultName)
  1251. '
  1252. '    Purpose: to change the Default domain to the one passed in by szNewDefaultName
  1253. '
  1254. '    Parameters:    szNewDefaultName -> The name of the Domain to be made the Default
  1255. '
  1256. '    Returns:
  1257. '
  1258. '    Created: 10/6/97 : Randy Slape
  1259. '
  1260. '---------------------------------------------------------------------------------------
  1261. Sub ChangeDefaultDomain(szNewDefaultName)
  1262.  
  1263.     szOldDefaultName = VServer.DefaultDomain
  1264.  
  1265.     On Error Resume Next
  1266.     Set OldDefault = smtpDomain.Create(szDomainClassString, szOldDefaultName)
  1267.     if (Err <> 0) then
  1268.         szError = GetErrorMessage(Err) %>
  1269.         <script language="javascript">
  1270.             alert("<% = szError %>");
  1271.         </script>
  1272. <%    end if
  1273.  
  1274.     OldDefault.RouteAction = SMTP_ALIAS
  1275.  
  1276.     VServer.DefaultDomain = szNewDefaultName
  1277.  
  1278.     On Error Resume Next
  1279.     smtpDomain.Delete szDomainClassString, szNewDefaultName
  1280.     if (Err <> 0) then
  1281.         szError = GetErrorMessage(Err) %>
  1282.         <script language="javascript">
  1283.             alert("<% = szError %>");
  1284.         </script>
  1285. <%    end if
  1286.  
  1287.     OldDefault.SetInfo
  1288.  
  1289.     VServer.SetInfo
  1290.  
  1291. End Sub
  1292. %>
  1293.  
  1294.  
  1295.