Apply suggestion from @CommanderStorm
This commit is contained in:
parent
c1ed583eb3
commit
272b9702fb
@ -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,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user