Author: ilgrosso
Date: Mon Sep 15 08:06:35 2014
New Revision: 1624961
URL: http://svn.apache.org/r1624961
Log:
[SYNCOPE-547] Setting mail.smtp.auth as true when SMTP username is provided
Modified:
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationJob.java
Modified:
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationJob.java
URL:
http://svn.apache.org/viewvc/syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationJob.java?rev=1624961&r1=1624960&r2=1624961&view=diff
==============================================================================
---
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationJob.java
(original)
+++
syncope/branches/1_1_X/core/src/main/java/org/apache/syncope/core/notification/NotificationJob.java
Mon Sep 15 08:06:35 2014
@@ -21,6 +21,7 @@ package org.apache.syncope.core.notifica
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Date;
+import java.util.Properties;
import javax.mail.internet.MimeMessage;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.SyncopeConstants;
@@ -160,6 +161,10 @@ public class NotificationJob implements
sender.setDefaultEncoding(SyncopeConstants.DEFAULT_ENCODING);
if (StringUtils.isNotBlank(smtpUsername)) {
sender.setUsername(smtpUsername);
+
+ Properties javaMailProperties = new Properties();
+ javaMailProperties.setProperty("mail.smtp.auth",
"true");
+ sender.setJavaMailProperties(javaMailProperties);
}
if (StringUtils.isNotBlank(smtpPassword)) {
sender.setPassword(smtpPassword);