|
Author: jleroux
Date: Sat Oct 6 16:55:33 2012 New Revision: 1395115 URL: http://svn.apache.org/viewvc?rev=1395115&view=rev Log: "Applied fix from trunk for revision: 1395104" ------------------------------------------------------------------------ r1395104 | jleroux | 2012-10-06 18:18:09 +0200 (sam., 06 oct. 2012) | 5 lines A patch from Varun Bhansaly "Email configuration - mail.smtp.starttls.enable ignored" https://issues.apache.org/jira/browse/OFBIZ-4943 The email configuration setting mail.smtp.starttls.enable is ignored by the system. I encountered this while configuring OFBiz an email server which had TLS enabled. ------------------------------------------------------------------------ Modified: ofbiz/branches/release11.04/ (props changed) ofbiz/branches/release11.04/framework/common/servicedef/services_email.xml ofbiz/branches/release11.04/framework/common/src/org/ofbiz/common/email/EmailServices.java Propchange: ofbiz/branches/release11.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1395104 Modified: ofbiz/branches/release11.04/framework/common/servicedef/services_email.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/common/servicedef/services_email.xml?rev=1395115&r1=1395114&r2=1395115&view=diff ============================================================================== --- ofbiz/branches/release11.04/framework/common/servicedef/services_email.xml (original) +++ ofbiz/branches/release11.04/framework/common/servicedef/services_email.xml Sat Oct 6 16:55:33 2012 @@ -41,6 +41,7 @@ under the License. <attribute name="socketFactoryFallback" type="String" mode="IN" optional="true"/> <attribute name="sendFailureNotification" mode="IN" type="Boolean" optional="true"/> <attribute name="sendPartial" mode="IN" type="Boolean" optional="true"/> + <attribute name="startTLSEnabled" mode="IN" type="Boolean" optional="true"/> <attribute name="subject" type="String" mode="INOUT" optional="true" allow-html="safe"/> <attribute name="contentType" type="String" mode="INOUT" optional="true"/> <attribute name="partyId" type="String" mode="INOUT" optional="true"/> Modified: ofbiz/branches/release11.04/framework/common/src/org/ofbiz/common/email/EmailServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/common/src/org/ofbiz/common/email/EmailServices.java?rev=1395115&r1=1395114&r2=1395115&view=diff ============================================================================== --- ofbiz/branches/release11.04/framework/common/src/org/ofbiz/common/email/EmailServices.java (original) +++ ofbiz/branches/release11.04/framework/common/src/org/ofbiz/common/email/EmailServices.java Sat Oct 6 16:55:33 2012 @@ -155,6 +155,7 @@ public class EmailServices { String messageId = (String) context.get("messageId"); String contentType = (String) context.get("contentType"); Boolean sendPartial = (Boolean) context.get("sendPartial"); + Boolean isStartTLSEnabled = (Boolean) context.get("startTLSEnabled"); boolean useSmtpAuth = false; @@ -188,6 +189,9 @@ public class EmailServices { if (sendPartial == null) { sendPartial = UtilProperties.propertyValueEqualsIgnoreCase("general.properties", "mail.smtp.sendpartial", "true") ? true : false; } + if (isStartTLSEnabled == null) { + isStartTLSEnabled = EntityUtilProperties.propertyValueEqualsIgnoreCase("general.properties", "mail.smtp.starttls.enable", "true", delegator); + } } else if (sendVia == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "CommonEmailSendMissingParameterSendVia", locale)); } @@ -225,6 +229,9 @@ public class EmailServices { if (sendPartial != null) { props.put("mail.smtp.sendpartial", sendPartial ? "true" : "false"); } + if (isStartTLSEnabled) { + props.put("mail.smtp.starttls.enable", "true"); + } session = Session.getInstance(props); boolean debug = UtilProperties.propertyValueEqualsIgnoreCase("general.properties", "mail.debug.on", "Y"); |
| Free forum by Nabble | Edit this page |
