fix: STARTTLS is not used (#10647)

This commit is contained in:
bleatingsheep
2025-11-16 02:13:53 +08:00
committed by GitHub
parent 9a180e486d
commit 31dee071dd
3 changed files with 16 additions and 2 deletions
+5
View File
@@ -194,6 +194,11 @@
"description": "Use a secure SMTP connection (optional)",
"required": false
},
"SMTP_DISABLE_STARTTLS": {
"value": "false",
"description": "Disable STARTTLS even if the server supports it (optional)",
"required": false
},
"SMTP_TLS_CIPHERS": {
"description": "Override SMTP cipher configuration (optional)",
"required": false
+2 -2
View File
@@ -224,8 +224,8 @@ export class Mailer {
pass: env.SMTP_PASSWORD,
}
: undefined,
// Disable STARTTLS entirely when secure is set to false
ignoreTLS: !env.SMTP_SECURE,
// Disable STARTTLS entirely when SMTP_DISABLE_STARTTLS is set to true
ignoreTLS: env.SMTP_DISABLE_STARTTLS,
tls: env.SMTP_SECURE
? env.SMTP_TLS_CIPHERS
? {
+9
View File
@@ -417,6 +417,15 @@ export class Environment {
*/
public SMTP_SECURE = this.toBoolean(environment.SMTP_SECURE ?? "true");
/**
* If true then STARTTLS is disabled even if the server supports it.
* If false (the default) then STARTTLS is used if server supports it.
*
* Setting secure to false therefore does not mean that you would not use an
* encrypted connection.
*/
public SMTP_DISABLE_STARTTLS = this.toBoolean(environment.SMTP_DISABLE_STARTTLS ?? "false");
/**
* Dropbox app key for embedding Dropbox files
*/