diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-06-04 14:24:36 +0100 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-06-04 14:24:36 +0100 |
commit | 2f62e1f6ff671bf6404bd90b1d945f8d029f0d37 (patch) | |
tree | 9fe0a00afa0b86a3988a1f55fe7330c7b451234f /synapse/config | |
parent | Lint (diff) | |
download | synapse-2f62e1f6ff671bf6404bd90b1d945f8d029f0d37.tar.xz |
Only parse from email if provided
Diffstat (limited to 'synapse/config')
-rw-r--r-- | synapse/config/emailconfig.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py index 7ca3505895..8400471f40 100644 --- a/synapse/config/emailconfig.py +++ b/synapse/config/emailconfig.py @@ -51,10 +51,11 @@ class EmailConfig(Config): self.email_app_name = "Matrix" self.email_notif_from = email_config.get("notif_from", None) - # make sure it's valid - parsed = email.utils.parseaddr(self.email_notif_from) - if self.email_notif_from and parsed[1] == '': - raise RuntimeError("Invalid notif_from address") + if self.email_notif_from is not None: + # make sure it's valid + parsed = email.utils.parseaddr(self.email_notif_from) + if parsed[1] == '': + raise RuntimeError("Invalid notif_from address") template_dir = email_config.get("template_dir") # we need an absolute path, because we change directory after starting (and |