feat(server): Option to configure SMTPS transport (#22833)

* feat(server): Option to configure SMTPS transport

This commit adds a boolean option in the SMTP transport configuration to
enable the so-called "secure" mode. What it does is use SMTP over TLS
instead of relying on the more common STARTTLS option over plain SMTP.

* Add missing field in dto

* Add missing field

* Use a switch instead of text field

* Add field in spec

* chore: regen open-api

---------

Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
Clement Martin 2025-10-17 12:21:27 +02:00 committed by GitHub
parent 81554e5ad1
commit 95889a69c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 33 additions and 1 deletions

View file

@ -17,6 +17,7 @@ class SystemConfigSmtpTransportDto {
required this.ignoreCert,
required this.password,
required this.port,
required this.secure,
required this.username,
});
@ -30,6 +31,8 @@ class SystemConfigSmtpTransportDto {
/// Maximum value: 65535
num port;
bool secure;
String username;
@override
@ -38,6 +41,7 @@ class SystemConfigSmtpTransportDto {
other.ignoreCert == ignoreCert &&
other.password == password &&
other.port == port &&
other.secure == secure &&
other.username == username;
@override
@ -47,10 +51,11 @@ class SystemConfigSmtpTransportDto {
(ignoreCert.hashCode) +
(password.hashCode) +
(port.hashCode) +
(secure.hashCode) +
(username.hashCode);
@override
String toString() => 'SystemConfigSmtpTransportDto[host=$host, ignoreCert=$ignoreCert, password=$password, port=$port, username=$username]';
String toString() => 'SystemConfigSmtpTransportDto[host=$host, ignoreCert=$ignoreCert, password=$password, port=$port, secure=$secure, username=$username]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -58,6 +63,7 @@ class SystemConfigSmtpTransportDto {
json[r'ignoreCert'] = this.ignoreCert;
json[r'password'] = this.password;
json[r'port'] = this.port;
json[r'secure'] = this.secure;
json[r'username'] = this.username;
return json;
}
@ -75,6 +81,7 @@ class SystemConfigSmtpTransportDto {
ignoreCert: mapValueOfType<bool>(json, r'ignoreCert')!,
password: mapValueOfType<String>(json, r'password')!,
port: num.parse('${json[r'port']}'),
secure: mapValueOfType<bool>(json, r'secure')!,
username: mapValueOfType<String>(json, r'username')!,
);
}
@ -127,6 +134,7 @@ class SystemConfigSmtpTransportDto {
'ignoreCert',
'password',
'port',
'secure',
'username',
};
}