You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2020/08/22 01:50:15 UTC

[kylin] branch master updated: KYLIN-4515 fix error with sending mail on ssl (#1214)

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new d8060b6  KYLIN-4515 fix error with sending mail on ssl (#1214)
d8060b6 is described below

commit d8060b658e7835fa3281ab1094bb5b14e622e133
Author: Chen Qing <ch...@gmail.com>
AuthorDate: Sat Aug 22 09:50:03 2020 +0800

    KYLIN-4515 fix error with sending mail on ssl (#1214)
    
    Here is context of this problem:https://www.mail-archive.com/user@kylin.apache.org/msg04009.html
    
    When we set `starttlsEnabled` to true, specify a ssl port as 465,  emails could not be sent by this ssl port, It still use 25 default port.
    
    The root cause is, with such config above, HTMLEmail client doesn't enable ssl connection, so we need to enable ssl connection by `setSSLOnConnect` as well when using ssl port.
---
 core-common/src/main/java/org/apache/kylin/common/util/MailService.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core-common/src/main/java/org/apache/kylin/common/util/MailService.java b/core-common/src/main/java/org/apache/kylin/common/util/MailService.java
index 6542d52..8b3dbdb 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/MailService.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/MailService.java
@@ -89,6 +89,7 @@ public class MailService {
         Email email = new HtmlEmail();
         email.setHostName(host);
         email.setStartTLSEnabled(starttlsEnabled);
+        email.setSSLOnConnect(starttlsEnabled);
         if (starttlsEnabled) {
             email.setSslSmtpPort(port);
         } else {