Apply suggestion from @CommanderStorm

This commit is contained in:
Frank Elsinga 2026-01-20 00:25:36 +01:00 committed by GitHub
parent c1ed583eb3
commit 272b9702fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,12 +18,7 @@ class SMTP extends NotificationProvider {
}; };
// Handle TLS/STARTTLS options // Handle TLS/STARTTLS options
if (notification.smtpSecure) { if (!notification.smtpSecure && notification.smtpIgnoreSTARTTLS) {
// 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 // Disable STARTTLS completely for servers that don't support it
// Connection will remain unencrypted // Connection will remain unencrypted
log.warn( log.warn(
@ -32,7 +27,8 @@ class SMTP extends NotificationProvider {
); );
config.ignoreTLS = true; config.ignoreTLS = true;
} else { } else {
// Allow STARTTLS (default behavior for ports 25, 587) // SMTPS (implicit TLS on port 465)
// or STARTTLS (default behavior for ports 25, 587)
config.tls = { config.tls = {
rejectUnauthorized: !notification.smtpIgnoreTLSError || false, rejectUnauthorized: !notification.smtpIgnoreTLSError || false,
}; };