fix: respect SMTP encryption setting for email notifications

The EsmtpTransport constructor expects bool|null for the tls parameter:
- null: auto-detect (try STARTTLS if supported)
- true: force implicit TLS (port 465)
- false: no encryption

Previously 'none' mapped to null which still attempted STARTTLS,
and 'tls' mapped to the string 'tls' instead of boolean true.

Fixes #6442
This commit is contained in:
shafeq 2026-02-27 19:11:08 +08:00
parent 78aea9a7ec
commit 212d30cea4

View file

@ -80,8 +80,8 @@ class EmailChannel
} elseif ($isSmtpEnabled) {
$encryption = match (strtolower($settings->smtp_encryption)) {
'starttls' => null,
'tls' => 'tls',
'none' => null,
'tls' => true,
'none' => false,
default => null,
};