From 38c6586521c3b41844a045f3ccde6d7cefdd6db6 Mon Sep 17 00:00:00 2001 From: Dharun Ashokkumar Date: Mon, 19 Jan 2026 23:45:54 +0530 Subject: [PATCH] fix: add option to disable STARTTLS for SMTP servers without TLS support Fixes #6018 - adds a 'Disable STARTTLS' checkbox that lets users connect to legacy SMTP servers that don't support encryption --- server/notification-providers/smtp.js | 20 +++++++++++++++++--- src/components/notifications/SMTP.vue | 18 ++++++++++++++++++ src/lang/en.json | 2 ++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/server/notification-providers/smtp.js b/server/notification-providers/smtp.js index ee17e70e1..b1d409948 100644 --- a/server/notification-providers/smtp.js +++ b/server/notification-providers/smtp.js @@ -14,11 +14,25 @@ class SMTP extends NotificationProvider { host: notification.smtpHost, port: notification.smtpPort, secure: notification.smtpSecure, - tls: { - rejectUnauthorized: !notification.smtpIgnoreTLSError || false, - }, }; + // Handle TLS/STARTTLS options + if (notification.smtpSecure) { + // SMTPS (implicit TLS on port 465) + config.tls = { + rejectUnauthorized: !notification.smtpIgnoreTLSError || false, + }; + } else if (notification.smtpIgnoreSTARTTLS) { + // Disable STARTTLS completely for servers that don't support it + // Connection will remain unencrypted + config.ignoreTLS = true; + } else { + // Allow STARTTLS (default behavior for ports 25, 587) + config.tls = { + rejectUnauthorized: !notification.smtpIgnoreTLSError || false, + }; + } + // Fix #1129 if (notification.smtpDkimDomain) { config.dkim = { diff --git a/src/components/notifications/SMTP.vue b/src/components/notifications/SMTP.vue index 030176e68..db62760e7 100644 --- a/src/components/notifications/SMTP.vue +++ b/src/components/notifications/SMTP.vue @@ -56,6 +56,24 @@ +
+
+ + +
+
+ {{ $t("disableSTARTTLSDescription") }} +
+
+