Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDEV-5030 - Bugfix Setup SMTP-Connection #2410

Open
wants to merge 1 commit into
base: 6.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 25 additions & 29 deletions core/src/main/cfml/context/admin/services.mail.cfm
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<!---
<!---
Defaults --->
<cfparam name="form.mainAction" default="none">
<cfparam name="error" default="#struct(message:"",detail:"")#">
<cfparam name="stveritfymessages" default="#struct()#">
<cfparam name="url.action2" default="list">
<cfadmin
<cfadmin
action="securityManager"
type="#request.adminType#"
password="#session["password"&request.adminType]#"
returnVariable="hasAccess"
secType="mail"
secValue="yes">
<cfadmin

<cfadmin
action="getMailSetting"
type="#request.adminType#"
password="#session["password"&request.adminType]#"
returnVariable="mail">
<cfadmin
<cfadmin
action="getMailServers"
type="#request.adminType#"
password="#session["password"&request.adminType]#"
Expand Down Expand Up @@ -75,34 +75,34 @@ Defaults --->
<!--- Setting --->
<cfcase value="#stText.Buttons.Setting#">
<cfif form._mainAction EQ stText.Buttons.update>
<cfadmin
<cfadmin
action="updateMailSetting"
type="#request.adminType#"
password="#session["password"&request.adminType]#"

spoolEnable="#isDefined("form.spoolenable") and form.spoolenable#"
timeout="#form.timeout#"
defaultEncoding="#form.defaultEncoding#"
remoteClients="#request.getRemoteClients()#">
<cfelseif form._mainAction EQ stText.Buttons.resetServerAdmin>
<!--- reset to server setting --->
<cfadmin
<cfadmin
action="updateMailSetting"
type="#request.adminType#"
password="#session["password"&request.adminType]#"

spoolEnable=""
timeout=""
defaultEncoding=""

remoteClients="#request.getRemoteClients()#">
</cfif>
</cfcase>
<!--- UPDATE --->
<cfcase value="#stText.Buttons.Update#">
<!--- update --->
<cfif form.subAction EQ "#stText.Buttons.Update#">

<cfset data.hosts=toArrayFromForm("hostname")>
<cfset data.usernames=toArrayFromForm("username")>
<cfset data.passwords=toArrayFromForm("password")>
Expand All @@ -113,15 +113,14 @@ Defaults --->
<cfset data.ids=toArrayFromForm("id")>
<cfset data.idles=toTimeSpan("idle")>
<cfset data.lifes=toTimeSpan("life")>

<cfloop index="idx" from="1" to="#arrayLen(data.hosts)#">
<cfif isDefined("data.rows[#idx#]") and data.hosts[idx] NEQ "">
<cfparam name="data.ports[idx]" default="25">
<cfif trim(data.ports[idx]) EQ "">
<cfset data.ports[idx]=25>
<cfif arrayIsDefined(data.rows, idx) and data.hosts[idx] NEQ "">
<cfif NOT arrayIsDefined(data.ports, idx) OR trim(data.ports[idx]) EQ "">
<cfset data.ports[idx] = 25 />
</cfif>
<cfset pw=toPassword(data.hosts[idx],session["password"&request.adminType], ms)>
<cfadmin
<cfadmin
action="updateMailServer"
type="#request.adminType#"
password="#pw#"
Expand All @@ -130,12 +129,10 @@ Defaults --->
dbpassword="#toPassword(data.hosts[idx],data.passwords[idx], ms)#"
life="#data.lifes[idx]#"
idle="#data.idles[idx]#"


port="#data.ports[idx]#"
id="#isDefined("data.ids[#idx#]")?data.ids[idx]:''#"
tls="#isDefined("data.tlss[#idx#]") and data.tlss[idx]#"
ssl="#isDefined("data.ssls[#idx#]") and data.ssls[idx]#"
id="#arrayIsDefined(data.ids, idx) ? data.ids[idx] : ''#"
tls="#arrayIsDefined(data.tlss, idx) and data.tlss[idx]#"
ssl="#arrayIsDefined(data.ssls, idx) and data.ssls[idx]#"
remoteClients="#request.getRemoteClients()#">
</cfif>
</cfloop>
Expand All @@ -148,13 +145,12 @@ Defaults --->
<cflock type="exclusive" scope="application" timeout="5"></cflock> --->
<cfset len=arrayLen(data.hosts)>
<cfloop index="idx" from="1" to="#len#">
<cfif isDefined("data.rows[#idx#]") and data.hosts[idx] NEQ "">
<cfadmin
<cfif arrayIsDefined(data.rows, idx) and data.hosts[idx] NEQ "">
<cfadmin
action="removeMailServer"
type="#request.adminType#"
password="#session["password"&request.adminType]#"

id="#isDefined("data.ids[#idx#]")?data.ids[idx]:''#"
id="#structKeyExists(data, "ids") and arrayIsDefined(data.ids, idx) ? data.ids[idx] : ''#"
hostname="#data.hosts[idx]#"
username="#data.usernames[idx]#"
remoteClients="#request.getRemoteClients()#">
Expand All @@ -168,9 +164,9 @@ Defaults --->
<cfset data.ports=toArrayFromForm("port")>
<cfset doNotRedirect=true>
<cfloop index="idx" from="1" to="#arrayLen(data.rows)#">
<cfif isDefined("data.rows[#idx#]") and isDefined("data.hosts[#idx#]") and data.hosts[idx] NEQ "">
<cfif arrayIsDefined(data.rows, idx) and arrayIsDefined(data.hosts, idx) and data.hosts[idx] NEQ "">
<cftry>
<cfadmin
<cfadmin
action="verifyMailServer"
type="#request.adminType#"
password="#session["password"&request.adminType]#"
Expand Down Expand Up @@ -217,7 +213,7 @@ Defaults --->
</cfcatch>
</cftry>

<!--- Redirtect to entry --->
<!--- Redirect to entry --->
<cfif cgi.request_method EQ "POST" and error.message EQ "" and not isDefined('doNotRedirect')>
<cflocation url="#request.self#?action=#url.action#" addtoken="no">
</cfif>
Expand Down
Loading