-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add email.tlsname config option (#17849)
The existing `email.smtp_host` config option is used for two distinct purposes: it is resolved into the IP address to connect to, and used to (request via SNI and) validate the server's certificate if TLS is enabled. This new option allows specifying a different name for the second purpose. This is especially helpful, if `email.smtp_host` isn't a global FQDN, but something that resolves only locally (e.g. "localhost" to connect through the loopback interface, or some other internally routed name), that one cannot get a valid certificate for. Alternatives would of course be to specify a global FQDN as `email.smtp_host`, or to disable TLS entirely, both of which might be undesirable, depending on the SMTP server configuration.
- Loading branch information
Showing
5 changed files
with
69 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Added the `email.tlsname` config option. This allows specifying the domain name used to validate the SMTP server's TLS certificate separately from the `email.smtp_host` to connect to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -673,8 +673,9 @@ This setting has the following sub-options: | |
TLS via STARTTLS *if the SMTP server supports it*. If this option is set, | ||
Synapse will refuse to connect unless the server supports STARTTLS. | ||
* `enable_tls`: By default, if the server supports TLS, it will be used, and the server | ||
must present a certificate that is valid for 'smtp_host'. If this option | ||
must present a certificate that is valid for `tlsname`. If this option | ||
is set to false, TLS will not be used. | ||
* `tlsname`: The domain name the SMTP server's TLS certificate must be valid for, defaulting to `smtp_host`. | ||
* `notif_from`: defines the "From" address to use when sending emails. | ||
It must be set if email sending is enabled. The placeholder '%(app)s' will be replaced by the application name, | ||
which is normally set in `app_name`, but may be overridden by the | ||
|
@@ -741,6 +742,7 @@ email: | |
force_tls: true | ||
require_transport_security: true | ||
enable_tls: false | ||
tlsname: mail.server.example.com | ||
notif_from: "Your Friendly %(app)s homeserver <[email protected]>" | ||
app_name: my_branded_matrix_server | ||
enable_notifs: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters