diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2021-08-06 11:13:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-06 10:13:34 +0000 |
commit | 74d7336686e7de1d0923d67af61b510ec801fa84 (patch) | |
tree | 241ec77732f909ac13d1f3c5cf2fdb1fc3ce10d2 /synapse/config | |
parent | Mark all MSC2716 events as historical (#10537) (diff) | |
download | synapse-74d7336686e7de1d0923d67af61b510ec801fa84.tar.xz |
Add a setting to disable TLS for sending email (#10546)
This is mostly useful in case the server offers TLS, but doesn't present a valid certificate.
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/emailconfig.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py index 8d8f166e9b..42526502f0 100644 --- a/synapse/config/emailconfig.py +++ b/synapse/config/emailconfig.py @@ -80,6 +80,12 @@ class EmailConfig(Config): self.require_transport_security = email_config.get( "require_transport_security", False ) + self.enable_smtp_tls = email_config.get("enable_tls", True) + if self.require_transport_security and not self.enable_smtp_tls: + raise ConfigError( + "email.require_transport_security requires email.enable_tls to be true" + ) + if "app_name" in email_config: self.email_app_name = email_config["app_name"] else: @@ -368,6 +374,14 @@ class EmailConfig(Config): # #require_transport_security: true + # Uncomment the following to disable TLS for SMTP. + # + # 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 + # is set to false, TLS will not be used. + # + #enable_tls: false + # notif_from defines the "From" address to use when sending emails. # It must be set if email sending is enabled. # |