IGNITE-16829 Support configurable mail smtp host, disabling auth and SSL+ test featur... master
authorDmitriy Pavlov <dpavlov@apache.org>
Fri, 22 Apr 2022 15:02:03 +0000 (18:02 +0300)
committerDmitriy Pavlov <dpavlov@apache.org>
Fri, 22 Apr 2022 15:02:03 +0000 (18:02 +0300)
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringService.java

index 53448dbf8ac5df2f3592a31b430b3383ca2b7831..58fbfceb7d0cd62d7d2f0eed005ca13ab57a684c 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.apache.ignite.ci.web.rest.monitoring;
 
  */
 package org.apache.ignite.ci.web.rest.monitoring;
 
+import com.google.common.base.Strings;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheMetrics;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheMetrics;
@@ -138,7 +139,8 @@ public class MonitoringService {
 
             ISendEmailConfig email = notifications.email();
             String plainText = "Test Email notification message!";
 
             ISendEmailConfig email = notifications.email();
             String plainText = "Test Email notification message!";
-            emailSender.sendEmail(address, subj, plainText, plainText, email);
+            String addressUnescaped = Strings.nullToEmpty(address).replace("%40", "@");
+            emailSender.sendEmail(addressUnescaped, subj, plainText, plainText, email);
         } catch (Exception e) {
             return new SimpleResult("Failed to send test Email message: " + e.getMessage());
         }
         } catch (Exception e) {
             return new SimpleResult("Failed to send test Email message: " + e.getMessage());
         }