summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-email-notifications-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sonar-email-notifications-plugin')
-rw-r--r--plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java
index a988fe52a4e..df3f5ea7769 100644
--- a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java
+++ b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/EmailNotificationChannel.java
@@ -173,6 +173,10 @@ public class EmailNotificationChannel extends NotificationChannel {
if (StringUtils.equalsIgnoreCase(configuration.getSecureConnection(), "SSL")) {
email.setSSL(true);
email.setSslSmtpPort(configuration.getSmtpPort());
+
+ // this port is not used except in EmailException message, that's why it's set with the same value than SSL port.
+ // It prevents from getting bad message.
+ email.setSmtpPort(Integer.parseInt(configuration.getSmtpPort()));
} else if (StringUtils.isBlank(configuration.getSecureConnection())) {
email.setSmtpPort(Integer.parseInt(configuration.getSmtpPort()));
} else {