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

  1. <% Response.Expires = 0 %>
  2.  
  3. <%
  4. REM LOCALIZATION
  5.  
  6. L_PAGETITLE_TEXT             = "Microsoft SMTP Server Administration"
  7. L_DELIVERYPROP_TEXT            = "Delivery Properties for: "
  8. L_LOCALQUEUE_TEXT            = "Local queue"
  9. L_REMOTEQUEUE_TEXT            = "Remote queue"
  10. L_TYPE_TEXT                    = "Type:"
  11. L_MAXIMUMRETRIES_TEXT        = "Maximum Retries:"
  12. L_RETRYINTERVAL_TEXT        = "Retry Interval(minutes):"
  13. L_MAXHOPCOUNT_TEXT            = "Maximum Hop Count:"
  14. L_MASQDOMAIN_TEXT            = "Masquerade Domain:"
  15. L_FQDN_TEXT                    = "Fully Qualified Domain Name:"
  16. L_SMARTHOST_TEXT            = "Smart Host:"
  17. L_SMART_HOST_WARN_TEXT        = "You must enter a SmartHost name to enable this option."
  18. L_ATTEMPT_TEXT                = "Attempt direct delivery before sending to smart host"
  19. L_ENABLEDNSLOOKUP_TEXT        = "Perform reverse DNS lookup on incoming messages"
  20. L_SSLPORT_TEXT                 = "Always Use TLS"
  21. L_ENTER_INT_BETWEEN_TEXT    = "Please enter an integer between "
  22. L_AND_TEXT                    = " and "
  23. L_OUTBOUNDSECURITY_TEXT        = "Outbound Security..."
  24. L_OUTBOUND_SECURITY_TITLE_TEXT    = "Outbound_Security"
  25. L_INVALID_DOMAIN_NAME_ERRORMESSAGE    = "Invalid domain name."
  26.  
  27. MAX_VALUE                    = 2147483648
  28.  
  29. REM END LOCALIZATION
  30.  
  31. %>
  32.  
  33. <% REM delivery Page %> 
  34.  
  35. <% REM Get variables %>
  36. <% REM svr = Server name %>
  37. <% REM siteInstance Server Instance %>
  38.  
  39. <% svr = Session("svr") %>
  40. <% siteInstance = Session("ServiceInstance") %>
  41.  
  42.  
  43. <HTML>
  44. <HEAD>
  45. <TITLE><% = L_PAGETITLE_TEXT %></TITLE>
  46. </HEAD>
  47.  
  48. <SCRIPT LANGUAGE="javascript">
  49. <% REM Create uForm object and methods %>
  50.  
  51.     uForm = new Object();
  52.     uForm.writeForm = writeForm;
  53.     uForm.readCache = readCache; 
  54.  
  55. <% REM Javascript function readCache loads fields from hiddenform in sidebar %>
  56.  
  57. function readCache()
  58. {
  59.     hform = top.menu.document.hiddenform;
  60.     uform = document.userform;
  61.     
  62.     if (hform != null)
  63.     {
  64.         uform.txtMaxLocalRetries.value         = hform.txtLocalRetries.value;
  65.         uform.txtLocalRetryInterval.value         = hform.txtLocalRetryTime.value;
  66.  
  67.         uform.txtMaxRemoteRetries.value        = hform.txtRemoteRetries.value;
  68.         uform.txtRemoteRetryInterval.value        = hform.txtRemoteRetryTime.value;
  69.  
  70.         uform.txtMaxHopCount.value             = hform.txtHopCount.value;
  71.         uform.txtMasqDomain.value             = hform.txtMasqDomain.value;
  72.         uform.txtFQDN.value                    = hform.txtFQDN.value;
  73.         uform.txtSmartHost.value            = hform.txtSmartHost.value;
  74.  
  75.         uform.hdnSmartHostType.value        = hform.txtSmartHostType.value;
  76.  
  77.         uform.chkEnableDnsLookup.checked        = txtTochk(hform.txtEnableDNSLookup);
  78.         uform.chkAttempt.checked                = txtTochk(hform.txtShouldDeliver);
  79.         Initialize();
  80.     }
  81.  
  82. }
  83.  
  84. <% REM Javascript function writeForm sets values in hiddenform %>
  85.  
  86. function writeForm()
  87. {
  88.     var lRc = boundsChecking();
  89.  
  90.     if((lRc) == true)
  91.     {    
  92.         hform = top.menu.document.hiddenform;
  93.         uform = document.userform;
  94.         
  95.         hform.txtLocalRetries.value            = uform.txtMaxLocalRetries.value;
  96.         hform.txtLocalRetryTime.value         = uform.txtLocalRetryInterval.value;
  97.  
  98.         hform.txtRemoteRetries.value        = uform.txtMaxRemoteRetries.value;
  99.         hform.txtRemoteRetryTime.value         = uform.txtRemoteRetryInterval.value;
  100.  
  101.         hform.txtHopCount.value             = uform.txtMaxHopCount.value;
  102.         hform.txtMasqDomain.value             = uform.txtMasqDomain.value;
  103.         hform.txtFQDN.value                 = uform.txtFQDN.value;
  104.         hform.txtSmartHost.value             = uform.txtSmartHost.value;
  105.  
  106.         hform.txtEnableDNSLookup.value        = chkToTxt(uform.chkEnableDnsLookup);
  107.         hform.txtShouldDeliver.value        = chkToTxt(uform.chkAttempt);
  108.         
  109.         if((uform.hdnSmartHostType.value != "") && (uform.chkAttempt.checked == true))
  110.         {
  111.             uform.hdnSmartHostType.value = "1";
  112.         }
  113.         else if ((uform.hdnSmartHostType.value != "") && (uform.chkAttempt.checked == false))
  114.         {
  115.             uform.hdnSmartHostType.value = "2";
  116.         }
  117.         else
  118.         {
  119.             uform.hdnSmartHostType.value = "0";
  120.         }
  121.  
  122.         hform.txtSmartHostType.value        = uform.hdnSmartHostType.value;
  123.         uform.submit();
  124.     }
  125. }
  126.  
  127. function Initialize()
  128. {
  129.     uform = document.userform;
  130.  
  131.     if (uform.hdnSmartHostType.value == "1")
  132.     {
  133.         uform.chkAttempt.checked                = txtTochk(uform.hdnSmartHostType);
  134.     }
  135.     else
  136.     {
  137.         uform.chkAttempt.checked                = false;
  138.     }
  139.  
  140.  
  141.  
  142. }
  143.  
  144.  
  145.  
  146.  
  147. function chkChange(chkControl, szString, altString)
  148. {
  149.     if (chkControl.checked == true)
  150.     {
  151.         return szString;
  152.     }
  153.     else
  154.     {
  155.         return altString;
  156.     }
  157. }
  158.  
  159. <% REM Javascript function setUpdated sets "updated" flag in hiddenform when a field is changed %>
  160.  
  161. function setUpdated()
  162. {
  163.     hform = top.menu.document.hiddenform;
  164.     uform = document.userform;
  165.     
  166.     if(hform.txtLocalRetries.value == uform.txtMaxLocalRetries.value)
  167.     {
  168.         if(hform.txtRemoteRetries.value == uform.txtMaxRemoteRetries.value)
  169.         {
  170.             if(hform.txtLocalRetryTime.value == uform.txtLocalRetryInterval.value)
  171.             {
  172.                 if(hform.txtRemoteRetryTime.value == uform.txtRemoteRetryInterval.value)
  173.                 {
  174.                     if(hform.txtHopCount.value == uform.txtMaxHopCount.value)
  175.                     {
  176.                         if(hform.txtMasqDomain.value == uform.txtMasqDomain.value)
  177.                         {
  178.                             if(hform.txtFQDN.value == uform.txtFQDN.value)
  179.                             {
  180.                                 if(hform.txtSmartHost.value == uform.txtSmartHost.value)
  181.                                 {
  182.                                     if(hform.txtEnableDNSLookup.value == chkToTxt(uform.chkEnableDnsLookup))
  183.                                     {
  184.                                         if(hform.txtSmartHostType.value == chkToTxt(uform.chkAttempt))
  185.                                         {
  186.                                             top.menu.document.hiddenform.updated.value = "false";
  187.                                             return;
  188.                                         }
  189.                                     }
  190.                                 }
  191.                             }
  192.                         }
  193.                     }
  194.                 }
  195.             }
  196.         }
  197.     }
  198.  
  199.     
  200.     top.menu.document.hiddenform.updated.value = "true";    
  201. }    
  202.  
  203.  
  204. <% REM Javascript function exchanges info from the hidden controls on the form and the non-hidden controls %>
  205. <% REM 6/12/97 Randy Slape %>
  206.  
  207. function txtTochk(thisControl)
  208. {
  209.     if(thisControl.value == "")
  210.     {
  211.         return false;
  212.     }
  213.     else if(thisControl.value == "0")
  214.     {
  215.         return false;
  216.     }
  217.     else
  218.     {
  219.         return true;
  220.     }
  221.     
  222. }
  223.                 
  224. function chkToTxt(chkControl) 
  225. {
  226.     if (chkControl.checked) 
  227.     {
  228.         return "1";
  229.     }
  230.     else 
  231.     {
  232.         return "0";
  233.     }
  234. }
  235.  
  236. function loadToolBar()
  237. {
  238.     top.frames[3].location = "srtb.asp?svr=<% = svr %>&pg=smdel";
  239. }
  240.  
  241. function checkRange(thisControl, low, high)
  242. {
  243.     if (isFull(thisControl.value) && isNum(thisControl.value))
  244.     {
  245.         if ((thisControl.value > high) || (thisControl.value < low))
  246.         {
  247.             alert("<%= L_ENTER_INT_BETWEEN_TEXT %>" + low + "<%= L_AND_TEXT %>" + high + ".");
  248.             thisControl.value = low;
  249.             thisControl.focus();
  250.             return false;
  251.         }
  252.         else
  253.         {
  254.             return true;
  255.         }
  256.     }
  257.     else
  258.     {
  259.         thisControl.value = low;
  260.         thisControl.focus();
  261.         return false;
  262.     }
  263.  
  264.  
  265. }
  266.  
  267.  
  268. function checkSmartHost(chkControl)
  269. {
  270.     uform = document.userform;
  271.     if(uform.txtSmartHost.value == "")
  272.     {
  273.         chkControl.checked = false;
  274.         alert("<%= L_SMART_HOST_WARN_TEXT %>");
  275.         uform.txtSmartHost.focus();
  276.         return;
  277.     }
  278.  
  279.     
  280.     if(chkControl.checked)
  281.     {
  282.         uform.hdnSmartHostType.value = "1";
  283.         return;        
  284.     }
  285.     else
  286.     {
  287.         uform.hdnSmartHostType.value = "2";
  288.         return;
  289.     }
  290.         
  291. }
  292.  
  293. function chkSHostTxt(txtControl)
  294. {
  295.     uform = document.userform;
  296.     if(txtControl.value == "")
  297.     {
  298.         uform.chkAttempt.checked = false;
  299.     }
  300. }
  301.  
  302. function boundsChecking()
  303. {
  304.     uform = document.userform;
  305.  
  306.     if(!(checkRange(uform.txtMaxLocalRetries, 0, 256)))
  307.     {
  308.         return false;
  309.     }
  310.  
  311.     if(!(checkRange(uform.txtMaxRemoteRetries, 0, 256)))
  312.     {
  313.         return false;
  314.     }
  315.  
  316.     if(!(checkRange(uform.txtLocalRetryInterval, 1, 65535)))
  317.     {
  318.         return false;
  319.     }
  320.  
  321.     if(!(checkRange(uform.txtRemoteRetryInterval, 1, 65535)))
  322.     {
  323.         return false;
  324.     }
  325.  
  326.     if(!(checkRange(uform.txtMaxHopCount, 10, 256)))
  327.     {
  328.         return false;
  329.     }
  330.  
  331.     if(!(checkLength(uform.txtMasqDomain)))
  332.     {
  333.         return false;
  334.     }
  335.  
  336.     if((uform.txtFQDN.value == null) || (uform.txtFQDN.value == ""))
  337.     {
  338.         alert("<% = L_INVALID_DOMAIN_NAME_ERRORMESSAGE %>");
  339.         return false;
  340.     }
  341.  
  342.     if(!(checkLength(uform.txtFQDN)))
  343.     {
  344.         return false;
  345.     }
  346.  
  347.     if(!(checkLength(uform.txtSmartHost)))
  348.     {
  349.         return false;
  350.     }
  351.  
  352.     return true;
  353.  
  354. }
  355.  
  356. function openOutboundSec()
  357. {
  358.     var width = 450;
  359.     var height = 330;
  360.     
  361.     <% if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then %>
  362.     <% else %>
  363.         width = width +25;
  364.         height = height + 50;
  365.     <% end if %>
  366.  
  367.     var path = "smosec.asp?svr=<% = svr %>&ServerInstance=<% = siteInstance %>";
  368.     var popbox = window.open(path,"<% = L_OUTBOUND_SECURITY_TITLE_TEXT %>","toolbar=no,scrollbars=no,directories=no,menubar=no,width="+width+",height="+height+",resizable=no");
  369.     if(popbox !=null)
  370.     {
  371.         if (popbox.opener == null)
  372.         {
  373.             popbox.opener = self;
  374.         }
  375.     }
  376.  
  377. }
  378.  
  379. <% REM Generic Javascript functions %>
  380. </script>
  381. <!--#include file="smisnum.htm" -->
  382. <!--#include file="smisfull.htm" -->
  383. <!--#include file="smchklen.htm" -->
  384.  
  385.  
  386. <BODY BGCOLOR="#CCCCCC" TEXT="#000000" TOPMARGIN="10" OnLoad="loadToolBar();">
  387.  
  388. <FORM NAME="userform" onSubmit="return false;">
  389. <INPUT NAME="hdnDescription" TYPE="hidden" VALUE="">
  390. <P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B><% = L_DELIVERYPROP_TEXT %>  </B></FONT><FONT FACE="Times New Roman" SIZE=3><I><% = svr %> /
  391. <script language="javascript">
  392.     uform = document.userform;
  393.     hform = top.menu.document.hiddenform;
  394.  
  395.     if (hform != null)
  396.     {
  397.  
  398.         uform.hdnDescription.value = hform.txtDescription.value;
  399.         document.write(uform.hdnDescription.value);
  400.     }
  401. </script>
  402. </I></FONT>
  403. <input type="hidden" name="hdnSmartHostType" value="">
  404. <input type="hidden" name="Direction" value="">
  405. <FONT FACE="Arial" SIZE=2>
  406.  
  407. <P>    
  408. <p>
  409. <blockquote>
  410. <TABLE BORDER="0" WIDTH="480">
  411. <TR><TD WIDTH="220">
  412.     <FONT SIZE=2 FACE="Arial"><%= L_LOCALQUEUE_TEXT %></font>
  413. </TD><TD WIDTH="220">
  414.     <FONT SIZE=2 FACE="Arial"><%= L_REMOTEQUEUE_TEXT %></font>
  415. </TD></TR>
  416. <TR><TD>
  417.     <table border="1" width="220">
  418.     <tr><td>
  419.     <table border="0" width="220">
  420.     <tr><td>
  421.         <FONT SIZE=2 FACE="Arial">
  422.         <%= L_MAXIMUMRETRIES_TEXT %>
  423.         </font>
  424.     </td><td>
  425.         <FONT SIZE=2 FACE="Arial">
  426.         <INPUT NAME="txtMaxLocalRetries" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=5>
  427.         </font>
  428.     </tr></td>
  429.     <tr><td>
  430.         <FONT SIZE=2 FACE="Arial"><%= L_RETRYINTERVAL_TEXT %></FONT>
  431.     </td><td>
  432.         <FONT SIZE=2 FACE="Arial">
  433.         <INPUT NAME="txtLocalRetryInterval" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=5>
  434.         </font>
  435.     </td></tr>
  436.     </table>
  437.     </td></tr>
  438.     </table>
  439. </TD><TD>
  440.     <table border="1" width="220">
  441.     <tr><td>
  442.     <table border="0" width="220">
  443.     <tr><td>
  444.         <FONT SIZE=2 FACE="Arial">
  445.         <%= L_MAXIMUMRETRIES_TEXT %>
  446.         </font>
  447.     </td><td>
  448.         <FONT SIZE=2 FACE="Arial">
  449.         <INPUT NAME="txtMaxRemoteRetries" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=5>
  450.         </font>
  451.     </tr></td>
  452.     <tr><td>
  453.         <FONT SIZE=2 FACE="Arial"><%= L_RETRYINTERVAL_TEXT %></FONT>
  454.     </td><td>
  455.         <FONT SIZE=2 FACE="Arial">
  456.         <INPUT NAME="txtRemoteRetryInterval" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=5>
  457.         </font>
  458.     </td></tr>
  459.     </table>
  460.     </td></tr>
  461.     </table>
  462. </TD></TR>
  463. </TABLE>
  464. <p>
  465. <table border=0 width=350>
  466.     <tr>
  467.         <td><FONT SIZE=2 FACE="Arial"><%= L_MAXHOPCOUNT_TEXT %></font></td>
  468.         <td>
  469.             <INPUT NAME="txtMaxHopCount" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=6>
  470.         </td>
  471.     </tr><tr>
  472.         <td><FONT SIZE=2 FACE="Arial"><%= L_MASQDOMAIN_TEXT %></font></td>
  473.         <td>
  474.             <INPUT NAME="txtMasqDomain" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=20>
  475.         </td>
  476.     </tr><tr>
  477.         <td><FONT SIZE=2 FACE="Arial"><%= L_FQDN_TEXT %></font></td>
  478.         <td>
  479.             <INPUT NAME="txtFQDN" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=20>
  480.         </td>
  481.     </tr><tr>
  482.         <td><FONT SIZE=2 FACE="Arial"><%= L_SMARTHOST_TEXT %></font></td>
  483.         <td>
  484.             <INPUT NAME="txtSmartHost" TYPE="text" VALUE="" OnBlur="chkSHostTxt(this);setUpdated();" OnChange="setUpdated();" SIZE=20>
  485.         </td>
  486.     </tr>
  487.     <tr>
  488.         <td colspan=2><FONT SIZE=2 FACE="Arial">
  489.             <INPUT NAME="chkAttempt" TYPE="checkbox" VALUE="" OnClick="checkSmartHost(this);setUpdated();">
  490.              <%= L_ATTEMPT_TEXT %></font>
  491.         </td>
  492.     </tr><tr>
  493.         <td colspan = "2">
  494.             <FONT SIZE=2 FACE="Arial">
  495.             <input name="chkEnableDnsLookup" type="checkbox" value="" OnClick="setUpdated();">
  496.              <% = L_ENABLEDNSLOOKUP_TEXT %></font>
  497.         </td>
  498.     </tr>
  499.     <tr>
  500.         <td colspan="2" Height="4">
  501.              
  502.         </td>
  503.     </tr>
  504.     <tr>
  505.         <td>
  506.             <FONT SIZE=2 FACE="Arial">
  507.             <input name="btnOutboundSec" type="button" value="<% = L_OUTBOUNDSECURITY_TEXT %>" size="20" OnClick="openOutboundSec();">
  508.             </font>
  509.         </td>
  510.     </tr>
  511.  
  512. </table>
  513. </BLOCKQUOTE>
  514. </FORM> 
  515. <script language="javascript">
  516.     readCache();
  517. </script>
  518.  
  519. </BODY>
  520. </HTML>
  521.  
  522.  
  523.     
  524.     
  525.  
  526.  
  527.