<% '---------------------------------------------------------------------------- ' ' ' File: smdomed.asp ' ' Description: Domain Editor ' ' Copyright (C) 1997 Microsoft Corporation ' '------------------------------------------------------------------------------%> <% Response.Expires = 0 %> <% SMTP_DROP = 1 ' 0x00000001 local, norma w/non-empty drop dir SMTP_SMARTHOST = 2 ' 0x00000002 remote w/ UseSSL not checked SMTP_SSL = 4 ' 0x00000004 remote w/ UseSSL checked SMTP_ALIAS = 16 ' 0x00000010 local, alias SMTP_DELIVER = 32 ' 0x00000020 local, normal w/ empty drop dir SMTP_DEFAULT = 64 ' 0x00000040 local, default SMTP_DOMAIN_RELAY = 4096 '0x00001000 Relay Flag REM Begin localization L_DOMAINNAME_TEXT = "Domain Name:" L_ADD_DOMAIN_ON_TEXT = "Add Domain on" L_EDITDOMAIN_TEXT = "Edit Domain on" L_LOCALDOMAIN_TEXT = "Local Domain" L_DEFAULTLOCAL_TEXT = "Default Local Domain" L_ALIASLOCAL_TEXT = "Alias Local Domain" L_NORMAL_TEXT = "Normal Local Domain" L_DROPDIR_TEXT = "Drop Directory:" L_REMOTEDOMAIN_TEXT = "Remote Domain" L_ROUTE_TEXT = "Route Domain:" L_USESSL_TEXT = "Use TLS" L_ALLOWETRN_TEXT = "Allow ETRN" L_EDITDOMPROP_TEXT = "Edit Domain Properties" L_ADDDOMAIN_TEXT = "Add Domain" L_OK_TEXT = "OK" L_CANCEL_TEXT = "Cancel" L_HELP_TEXT = "Help" 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." L_NOTIMPLEMENTED_TEXT = "This feature not yet implemented." L_ENTER_DROP_DIR_TEXT = "Please enter a drop directory path." L_CHOOSE_DOMAIN_TYPE_TEXT = "You haven't choosed an actual Domain Type" L_PATH_SYNTAX_INCORR_TEXT = "The Path syntax is incorrect." L_ENTER_DOMAIN_NAME_TEXT = "Please enter a Domain name." L_OUTBOUNDSECURITY_TEXT = "Outbound Security..." L_OUTBOUND_SECURITY_TITLE_TEXT = "Outbound_Security" 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." L_ALLOW_INCOMING_RELAY_TEXT = "Allow incoming mail to be relayed to this domain." L_INVALID_DOMAIN_NAME_ERRORMESSAGE = "Invalid domain name." L_NO_DOMAIN_NAME_ERRORMESSAGE = "You must enter a name for this domain." L_DOMAIN_TEXT = "Domain " L_ALREADYEXISTS_ERRORMESSAGE = " already exists." L_NEW_DOMAIN_SEC_TEXT = "You cannot edit the OutBound Security properties until you save this domain." DOMAINS_TEXT = "domain" REM end localization %> <% REM Domains Page add/edit pop-up %> <% REM Get variables %> <% REM svr = Server name %> <% REM a = Action to be performed by server-side code (new/add,edit/save) %> <% REM DirVirtualName = Virtual Directory being edited %> <% REM DirHome = Whether a home directory already exists for service %> <% svr = Session("svr") %> <% a = Request("a") %> <% DomainName = Request("DomainName") %> <% DirHome = Request("DirHome") %> <% DomainIndex = Request("index") %> <% RouteDomain = Request("hdnRouteDomain") %> <% ServerInstance = Session("ServiceInstance") if (ServerInstance = "") then ServerInstance = Request("ServiceInstance") if (ServerInstance = "") then ServerInstance = "1" end if end if Session("ServiceInstance") = ServerInstance %> <% REM Include _cnst file to force logon by anonymous users (if access denied, body of file ignored) %> <% if (cont = true) then %> <% REM Generic Javascript function nnisFull returns alert if field is empty %> <% if (a = "edit") then %> <%= L_EDITDOMPROP_TEXT %> <% elseif (a = "new") then %> <%= L_ADDDOMAIN_TEXT %> <% end if %>

  <% if (a = "edit") then %> <% = L_EDITDOMAIN_TEXT%> <% elseif (a = "new") then %> <%= L_ADD_DOMAIN_ON_TEXT %> <% end if %> <% = svr %> <% if (actionType <> SMTP_DEFAULT) then %>
<%= L_DOMAINNAME_TEXT%> <% if (actionType = SMTP_DEFAULT) then %>
   <% = DomainName %>   
<% else %> <% end if %>
 
<% = L_LOCALDOMAIN_TEXT %>
  <% = L_DEFAULTLOCAL_TEXT %>
  <% = L_ALIASLOCAL_TEXT %>
  <% = L_DROPDIR_TEXT %>
 
 
<% = L_REMOTEDOMAIN_TEXT %>
<% = L_ROUTE_TEXT %>
 
 <% = L_ALLOW_INCOMING_RELAY_TEXT %>
 
<% else %>
<% end if %>
 

<% end if %>

<% = L_OK_TEXT%>
<% = L_CANCEL_TEXT %>
<% = L_HELP_TEXT %>
 

<% '--------------------------------------------------------------------------------------- ' ' Function ChangeDefaultDomain(szNewDefaultName) ' ' Purpose: to change the Default domain to the one passed in by szNewDefaultName ' ' Parameters: szNewDefaultName -> The name of the Domain to be made the Default ' ' Returns: ' ' Created: 10/6/97 : Randy Slape ' '--------------------------------------------------------------------------------------- Sub ChangeDefaultDomain(szNewDefaultName) szOldDefaultName = VServer.DefaultDomain On Error Resume Next Set OldDefault = smtpDomain.Create(szDomainClassString, szOldDefaultName) if (Err <> 0) then szError = GetErrorMessage(Err) %> <% end if OldDefault.RouteAction = SMTP_ALIAS VServer.DefaultDomain = szNewDefaultName On Error Resume Next smtpDomain.Delete szDomainClassString, szNewDefaultName if (Err <> 0) then szError = GetErrorMessage(Err) %> <% end if OldDefault.SetInfo VServer.SetInfo End Sub %>