home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
ims.cab
/
smmes.asp
< prev
next >
Wrap
Text File
|
1997-10-18
|
14KB
|
503 lines
<%
'----------------------------------------------------------------------------
'
'
' File: smnes.asp
'
' Description: Messages Properties page
'
' Copyright (C) 1997 Microsoft Corporation
'
'------------------------------------------------------------------------------
%>
<% Response.Expires = 0 %>
<%
REM LOCALIZATION
L_PAGETITLE_TEXT = "Microsoft SMTP Server Administration"
L_MESSAGEPROP_TEXT = "Message Properties for: "
L_LIMITMESSAGES_TEXT = "Limit Messages"
L_MAXMESSAGESIZE_TEXT = "Maximum Message Size:"
L_MAXSESSIONSIZE_TEXT = "Maximum Session Size:"
L_KILOBYTES_TEXT = "Kilobytes"
L_LIMITMESRECIPIENTS_TEXT = "Maximum Recipients per Message:"
L_SENDNDR_TEXT = "Send a Copy of Non-delivery Report to:"
L_SENDBADMAIL_TEXT = "Send a Copy of Badmail to:"
L_BADMAILDIR_TEXT = "Badmail Directory:"
L_LIMITMESCONNECTIONS_TEXT = "Limit Messages per Connection:"
L_YES_TEXT = "Yes"
L_NO_TEXT = "No"
L_PATH_SYNTAX_INCORR_TEXT = "The Path syntax is incorrect."
L_ENTER_INT_BETWEEN_TEXT = "Please enter an integer between "
L_AND_TEXT = " and "
L_BOGUSPATH_TEXT = "BadMail Directory must have a value."
MAXKILO_VALUE = 2097151
MAX_VALUE = 2000000000
REM END LOCALIZATION
%>
<% REM Messages Page %>
<% REM Get variables %>
<% REM svr = Server name %>
<%
svr = Session("svr")
%>
<HTML>
<HEAD>
<TITLE><% = L_PAGETITLE_TEXT %></TITLE>
</HEAD>
<SCRIPT LANGUAGE="javascript">
<% REM Create uForm object and methods %>
uForm = new Object();
uForm.writeForm = writeForm;
uForm.readCache = readCache;
var iCount = 0;
<% REM Javascript function readCache loads fields from hiddenform in sidebar %>
function readCache()
{
hform = top.menu.document.hiddenform;
uform = document.userform;
if (hform != null)
{
uform.txtMaxMessageSize.value = hform.txtMaxMessageSize.value;
uform.hdnMaxMessageSize.value = hform.txtMaxMessageSize.value;
uform.txtMaxSessionSize.value = hform.txtMaxSessionSize.value;
uform.hdnMaxSessionSize.value = hform.txtMaxSessionSize.value;
uform.txtMaxMessageRecipients.value = hform.txtMaxMessageRecipients.value;
uform.txtSendNDRTo.value = hform.txtSendNDRTo.value;
uform.txtBadMailDir.value = hform.txtBadMailDir.value;
uform.hdnDescription.value = hform.txtDescription.value;
uform.hdnLimitMessages.value = hform.txtLimitMessages.value;
uform.hdntxtLimitMessPerConnection.value = hform.txtBatchMessageLimit.value
uform.txtLimitMessPerConnection.value = hform.txtBatchMessageLimit.value;
uform.hdnLimitMessPerConnection.value = hform.txtBatchMessages.value;
Initialize()
}
}
<% REM Javascript function writeForm sets values in hiddenform %>
function writeForm()
{
hform = top.menu.document.hiddenform;
uform = document.userform;
var lRc = boundsChecking();
if((lRc) == true)
{
hform.txtMaxMessageRecipients.value = uform.txtMaxMessageRecipients.value;
hform.txtSendNDRTo.value = uform.txtSendNDRTo.value;
hform.txtBadMailDir.value = uform.txtBadMailDir.value;
hform.txtLimitMessages.value = uform.hdnLimitMessages.value;
hform.txtBatchMessageLimit.value = uform.txtLimitMessPerConnection.value;
hform.txtBatchMessages.value = chkToTxt(uform.chkLimitMessPerConnection);
if(uform.chkLimitMessPerConnection.checked != true)
{
hform.txtBatchMessageLimit.value = "0";
}
if(uform.chkLimitMessages.checked != true)
{
uform.txtMaxMessageSize.value = "0";
uform.txtMaxSessionSize.value = "0";
}
hform.txtMaxMessageSize.value = uform.txtMaxMessageSize.value;
hform.txtMaxSessionSize.value = uform.txtMaxSessionSize.value;
}
}
function Initialize()
{
uform = document.userform;
if((uform.hdnMaxMessageSize.value == "0" || uform.hdnMaxMessageSize.value == "") && (uform.hdnMaxSessionSize.value == "0" || uform.hdnMaxSessionSize.value == ""))
{
uform.chkLimitMessages.checked = false;
uform.txtMaxMessageSize.value = "";
uform.txtMaxSessionSize.value = "";
}
else
{
uform.chkLimitMessages.checked = true;
uform.txtMaxMessageSize.value = uform.hdnMaxMessageSize.value;
uform.txtMaxSessionSize.value = uform.hdnMaxSessionSize.value;
}
if(uform.hdntxtLimitMessPerConnection.value == "0" || uform.hdntxtLimitMessPerConnection.value == "")
{
uform.chkLimitMessPerConnection.checked = false;
uform.txtLimitMessPerConnection.value = "";
}
else
{
uform.chkLimitMessPerConnection.checked = true;
if(uform.hdntxtLimitMessPerConnection.value == "0" || uform.hdntxtLimitMessPerConnection.value == "")
{
uform.txtLimitMessPerConnection.value = "20";
uform.hdntxtLimitMessPerConnection.value = "20";
}
else
{
uform.txtLimitMessPerConnection.value = uform.hdntxtLimitMessPerConnection.value;
}
}
}
<% REM Javascript function chkChar %>
function chkDir(txtfield)
{
txtvalue = txtfield.value
if(txtvalue != "")
{
i = (txtvalue.indexOf("'") + txtvalue.indexOf('"'));
i = (i + txtvalue.indexOf("<") + txtvalue.indexOf('>') + txtvalue.indexOf('%'));
i = (i + txtvalue.indexOf("&") + txtvalue.indexOf("#") + txtvalue.indexOf("("));
i = (i + txtvalue.indexOf("+") + txtvalue.indexOf(")") + txtvalue.indexOf("@"));
i = (i + txtvalue.indexOf("~") + txtvalue.indexOf("`") + txtvalue.indexOf("!"));
i = (i + txtvalue.indexOf("^") + txtvalue.indexOf("*") + txtvalue.indexOf("="));
i = (i + txtvalue.indexOf("|") + txtvalue.indexOf(";"));
i = (i + txtvalue.indexOf(",") + txtvalue.indexOf("?"));
if (i != -21)
{
alert("<%= L_PATH_SYNTAX_INCORR_TEXT %>");
txtfield.value = "";
txtfield.focus();
return false;
}
}
else
{
if (iCount == 0)
{
alert("<% = L_BOGUSPATH_TEXT %>");
iCount++;
}
uform = document.userform;
top.menu.document.hiddenform.updated.value = "false";
uform.submit();
return false;
}
return true;
}
<% REM Javascript function setUpdated sets "updated" flag in hiddenform when a field is changed %>
function setUpdated()
{
hform = top.menu.document.hiddenform;
uform = document.userform;
if (hform.txtMaxMessageRecipients.value == uform.txtMaxMessageRecipients.value)
{
if (hform.txtSendNDRTo.value == uform.txtSendNDRTo.value)
{
if (hform.txtBadMailDir.value == uform.txtBadMailDir.value)
{
if (hform.txtLimitMessages.value == uform.hdnLimitMessages.value)
{
if (hform.txtBatchMessageLimit.value == uform.txtLimitMessPerConnection.value)
{
if (hform.txtBatchMessages.value == chkToTxt(uform.chkLimitMessPerConnection))
{
if (hform.txtMaxMessageSize.value == uform.txtMaxMessageSize.value)
{
if (hform.txtMaxSessionSize.value == uform.txtMaxSessionSize.value)
{
if((uform.txtBadMailDir.value == "") || (uform.txtBadMailDir.value == null))
{
top.menu.document.hiddenform.updated.value = "false";
return;
}
}
}
}
}
}
}
}
}
top.menu.document.hiddenform.updated.value = "true";
}
<% REM Javascript function switchInfo() exchanges info from the hidden controls on the form and the non-hidden controls %>
<% REM 6/12/97 Randy Slape %>
function txtTochk(thisControl)
{
if(thisControl.value == "")
{
return false;
}
else if(thisControl.value == "0")
{
return false;
}
else
{
return true;
}
}
function chkToTxt(chkControl)
{
if (chkControl.checked)
{
return "1";
}
else
{
return "0";
}
}
function cacheData()
{
uform = document.userform;
if(uform.txtMaxMessageSize.value != "")
{
uform.hdnMaxMessageSize.value = uform.txtMaxMessageSize.value;
}
if(uform.txtMaxSessionSize.value != "")
{
uform.hdnMaxSessionSize.value = uform.txtMaxSessionSize.value;
}
}
function infoSwitch()
{
uform = document.userform;
if(uform.chkLimitMessages.checked)
{
uform.txtMaxMessageSize.value = uform.hdnMaxMessageSize.value;
uform.txtMaxSessionSize.value = uform.hdnMaxSessionSize.value;
}
else
{
uform.hdnMaxMessageSize.value = uform.txtMaxMessageSize.value;
uform.hdnMaxSessionSize.value = uform.txtMaxSessionSize.value;
uform.txtMaxMessageSize.value = "";
uform.txtMaxSessionSize.value = "";
}
}
<% REM Javascript function checkRange checks values between 0 and specified range %>
function checkRange(thisControl, low, high)
{
if (isFull(thisControl.value) && isNum(thisControl.value))
{
if ((thisControl.value > high) || (thisControl.value < low))
{
alert("<%= L_ENTER_INT_BETWEEN_TEXT %>" + low + "<%= L_AND_TEXT %>" + high + ".");
thisControl.value = low;
thisControl.focus();
return false;
}
else
{
return true;
}
}
else
{
thisControl.value = low;
thisControl.focus();
return false;
}
}
function loadToolBar()
{
top.frames[3].location = "srtb.asp?pg=smmes&svr=<% = svr %>";
}
function limitperconn(chkControl)
{
uform = document.userform;
if(chkControl.checked)
{
if ((uform.hdntxtLimitMessPerConnection.value == "0") || (uform.hdntxtLimitMessPerConnection.value == ""))
{
uform.hdntxtLimitMessPerConnection.value = "20";
}
uform.txtLimitMessPerConnection.value = uform.hdntxtLimitMessPerConnection.value;
}
else
{
uform.hdntxtLimitMessPerConnection.value = uform.txtLimitMessPerConnection.value;
uform.txtLimitMessPerConnection.value = "";
}
}
function boundsChecking()
{
uform = document.userform;
if(uform.chkLimitMessages.checked)
{
if(!(checkRange(uform.txtMaxMessageSize, 0, <% = MAXKILO_VALUE %>)))
{
return false;
}
if(!(checkRange(uform.txtMaxSessionSize, 0, <% = MAXKILO_VALUE %>)))
{
return false;
}
}
if(uform.chkLimitMessPerConnection.checked)
{
if(!(checkRange(uform.txtLimitMessPerConnection, 1, <% = MAX_VALUE %>)))
{
return false;
}
}
if(!(checkRange(uform.txtMaxMessageRecipients, 100, <% = MAX_VALUE %>)))
{
return false;
}
if(!(chkDir(uform.txtBadMailDir)))
{
return false;
}
return true;
}
<% REM Generic Javascript functions %>
</script>
<!--#include file="smisnum.htm" -->
<!--#include file="smisfull.htm" -->
<!--#include file="smchklen.htm" -->
<BODY BGCOLOR="#CCCCCC" TEXT="#000000" TOPMARGIN="10" OnLoad="loadToolBar();">
<FORM NAME="userform" Action="smmes.asp" Method="post">
<INPUT NAME="hdnDescription" TYPE="hidden" VALUE="">
<P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B><% = L_MESSAGEPROP_TEXT %> </B></FONT><FONT FACE="Times New Roman" SIZE=3><I><% = svr %>
<script language="javascript">
uform = document.userform;
hform = top.menu.document.hiddenform;
uform.hdnDescription.value = hform.txtDescription.value;
document.write(uform.hdnDescription.value);
</script>
</I></FONT>
<FONT FACE="Arial" SIZE=2>
<P>
<p>
<blockquote>
<TABLE border=1 width=475>
<tr><td>
<table border=0 width=100%>
<tr>
<TD colspan=2>
<FONT SIZE=2 FACE="Arial">
<INPUT NAME="chkLimitMessages" TYPE="checkbox" VALUE="Limit Messages" OnClick="infoSwitch();setUpdated();"><% = L_LIMITMESSAGES_TEXT %>
</FONT>
<INPUT NAME="hdnLimitMessages" TYPE="hidden" VALUE="">
</td>
</tr><tr>
<td><FONT SIZE=2 FACE="Arial"><% = L_MAXMESSAGESIZE_TEXT %></FONT></td>
<td>
<INPUT NAME="txtMaxMessageSize" TYPE="text" VALUE="" OnBlur="cacheData();setUpdated();" OnChange="cacheData();setUpdated();" SIZE=10>
<FONT SIZE=2 FACE="Arial"><% = L_KILOBYTES_TEXT %></font>
<INPUT NAME="hdnMaxMessageSize" TYPE="hidden" VALUE="">
</td>
</tr><tr>
<td><FONT SIZE=2 FACE="Arial"><%= L_MAXSESSIONSIZE_TEXT %></FONT></td>
<td>
<INPUT NAME="txtMaxSessionSize" TYPE="text" VALUE="" OnBlur="cacheData();setUpdated();" OnChange="cacheData();setUpdated();" SIZE=10>
<FONT SIZE=2 FACE="Arial"><% = L_KILOBYTES_TEXT %></font>
<INPUT NAME="hdnMaxSessionSize" TYPE="hidden" VALUE="">
</td>
</tr>
</table>
</td></tr>
</table>
<table border="0" width=475>
<TR>
<td width="220">
<FONT SIZE=2 FACE="Arial">
<input name="chkLimitMessPerConnection" type="checkbox" value="Limit Messages Per Connection" OnClick="limitperconn(this);setUpdated();"> <% = L_LIMITMESCONNECTIONS_TEXT %>
</font>
<input name="hdnLimitMessPerConnection" type="hidden" value="">
</td>
<td width=220>
<input name="txtLimitMessPerConnection" type="text" value="" OnBlur="setUpdated();" OnChange="setUpdated();" size="10">
<input name="hdntxtLimitMessPerConnection" type="hidden" value="">
</td>
</tr><tr>
<td width=220><FONT SIZE=2 FACE="Arial"><%= L_LIMITMESRECIPIENTS_TEXT %></font></td>
<td>
<INPUT NAME="txtMaxMessageRecipients" TYPE="text" VALUE="" OnBlur="setUpdated();" OnChange="setUpdated();" SIZE=10>
</td>
</tr><tr>
<td width=220><FONT SIZE=2 FACE="Arial"><%= L_SENDNDR_TEXT %></font></td>
<td>
<INPUT NAME="txtSendNDRTo" TYPE="text" VALUE="" OnBlur="checkLength(this);setUpdated();" OnChange="setUpdated();" SIZE=25>
</td>
</tr><tr>
<td width=220><FONT SIZE=2 FACE="Arial"><%= L_BADMAILDIR_TEXT %></font></td>
<td>
<INPUT NAME="txtBadMailDir" TYPE="text" VALUE="" OnBlur="checkLength(this);setUpdated();" OnChange="setUpdated();" SIZE=25>
</td>
</tr>
</table>
</BLOCKQUOTE>
</FORM>
<script language="javascript">
readCache();
</script>
</BODY>
</HTML>