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") }} +
+
+