You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/02/03 06:20:27 UTC

[incubator-dolphinscheduler] branch dev updated: [Fix-4641][Alert] Sending the email to the following server failed :null:null (#4642)

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

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 6df87b8  [Fix-4641][Alert] Sending the email to the following server failed :null:null (#4642)
6df87b8 is described below

commit 6df87b89d7b0ec013c5a2bfdfb92fa3ff1496c40
Author: zhuangchong <37...@users.noreply.github.com>
AuthorDate: Wed Feb 3 14:20:16 2021 +0800

    [Fix-4641][Alert] Sending the email to the following server failed :null:null (#4642)
    
    * fix alert-server email send error.
    
    * update mail util test class.
---
 .../plugin/alert/email/MailParamsConstants.java      | 20 ++++++++++----------
 .../plugin/alert/email/MailUtilsTest.java            |  1 +
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java
index 0bbbe10..9b49b47 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailParamsConstants.java
@@ -33,33 +33,33 @@ public class MailParamsConstants {
     public static final String NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS = "receiverCcs";
 
     public static final String MAIL_PROTOCOL = "transport.protocol";
-    public static final String NAME_MAIL_PROTOCOL = "protocol";
+    public static final String NAME_MAIL_PROTOCOL = "mail.protocol";
 
-    public static final String MAIL_SMTP_HOST = "smtp.host";
+    public static final String MAIL_SMTP_HOST = "mail.smtp.host";
     public static final String NAME_MAIL_SMTP_HOST = "serverHost";
 
-    public static final String MAIL_SMTP_PORT = "smtp.port";
+    public static final String MAIL_SMTP_PORT = "mail.smtp.port";
     public static final String NAME_MAIL_SMTP_PORT = "serverPort";
 
-    public static final String MAIL_SENDER = "sender";
+    public static final String MAIL_SENDER = "mail.sender";
     public static final String NAME_MAIL_SENDER = "sender";
 
-    public static final String MAIL_SMTP_AUTH = "smtp.auth";
+    public static final String MAIL_SMTP_AUTH = "mail.smtp.auth";
     public static final String NAME_MAIL_SMTP_AUTH = "enableSmtpAuth";
 
-    public static final String MAIL_USER = "user";
+    public static final String MAIL_USER = "mail.user";
     public static final String NAME_MAIL_USER = "user";
 
-    public static final String MAIL_PASSWD = "passwd";
+    public static final String MAIL_PASSWD = "mail.passwd";
     public static final String NAME_MAIL_PASSWD = "passwd";
 
-    public static final String MAIL_SMTP_STARTTLS_ENABLE = "smtp.starttls.enable";
+    public static final String MAIL_SMTP_STARTTLS_ENABLE = "mail.smtp.starttls.enable";
     public static final String NAME_MAIL_SMTP_STARTTLS_ENABLE = "starttlsEnable";
 
-    public static final String MAIL_SMTP_SSL_ENABLE = "smtp.ssl.enable";
+    public static final String MAIL_SMTP_SSL_ENABLE = "mail.smtp.ssl.enable";
     public static final String NAME_MAIL_SMTP_SSL_ENABLE = "sslEnable";
 
-    public static final String MAIL_SMTP_SSL_TRUST = "smtp.ssl.trust";
+    public static final String MAIL_SMTP_SSL_TRUST = "mail.smtp.ssl.trust";
     public static final String NAME_MAIL_SMTP_SSL_TRUST = "smtpSslTrust";
 
 }
diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java
index e19c819..5b0b084 100644
--- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java
+++ b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/test/java/org/apache/dolphinscheduler/plugin/alert/email/MailUtilsTest.java
@@ -53,6 +53,7 @@ public class MailUtilsTest {
         emailConfig.put(MailParamsConstants.NAME_MAIL_SENDER, "xxx1.xxx.com");
         emailConfig.put(MailParamsConstants.NAME_MAIL_USER, "xxx2.xxx.com");
         emailConfig.put(MailParamsConstants.NAME_MAIL_PASSWD, "111111");
+        emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_AUTH, "true");
         emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_STARTTLS_ENABLE, "true");
         emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_SSL_ENABLE, "false");
         emailConfig.put(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST, "false");