From 64b3e04d3f8dbf65e25e94da960ab76c91a40336 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Thu, 6 Jan 2022 14:34:45 +0800 Subject: [PATCH] Fix #1129 --- server/notification-providers/smtp.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/smtp.js b/server/notification-providers/smtp.js index 1be68aea..d85ee88c 100644 --- a/server/notification-providers/smtp.js +++ b/server/notification-providers/smtp.js @@ -14,16 +14,20 @@ class SMTP extends NotificationProvider { secure: notification.smtpSecure, tls: { rejectUnauthorized: notification.smtpIgnoreTLSError || false, - }, - dkim: { + } + }; + + // Fix #1129 + if (notification.smtpDkimDomain) { + config.dkim = { domainName: notification.smtpDkimDomain, keySelector: notification.smtpDkimKeySelector, privateKey: notification.smtpDkimPrivateKey, hashAlgo: notification.smtpDkimHashAlgo, headerFieldNames: notification.smtpDkimheaderFieldNames, skipFields: notification.smtpDkimskipFields, - } - }; + }; + } // Should fix the issue in https://github.com/louislam/uptime-kuma/issues/26#issuecomment-896373904 if (notification.smtpUsername || notification.smtpPassword) {