From 1dfde72452e891e46bb9d39affe6d74996685574 Mon Sep 17 00:00:00 2001 From: johnnygo920 <61645312+johnnygo920@users.noreply.github.com> Date: Tue, 14 Jul 2020 23:22:42 +0800 Subject: [PATCH] [BUG#2359][Alert] Mail Chinese name is too long garbled (#3199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 解决中文附件名过长时邮件附件中文乱码问题 * Solve the problem of messy Chinese name in excel attachment * SonarCloud Code Analysis is not running . retry commit * Update MailUtils.java Co-authored-by: johnnygo920 Co-authored-by: dailidong --- .../org/apache/dolphinscheduler/alert/utils/MailUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/MailUtils.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/MailUtils.java index bb565f5133..6f67462771 100644 --- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/MailUtils.java +++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/MailUtils.java @@ -65,6 +65,10 @@ public class MailUtils { public static final AlertTemplate alertTemplate = AlertTemplateFactory.getMessageTemplate(); + //Solve the problem of messy Chinese name in excel attachment + static { + System.setProperty("mail.mime.splitlongparameters","false"); + } /** * send mail to receivers @@ -341,4 +345,5 @@ public class MailUtils { retMap.put(Constants.MESSAGE, "Send email to {" + String.join(",", receivers) + "} failed," + e.toString()); } + }