Skip to content
Snippets Groups Projects
Unverified Commit 2f62e1f6 authored by Brendan Abolivier's avatar Brendan Abolivier
Browse files

Only parse from email if provided

parent 1cc5fc1f
No related branches found
No related tags found
No related merge requests found
...@@ -51,10 +51,11 @@ class EmailConfig(Config): ...@@ -51,10 +51,11 @@ class EmailConfig(Config):
self.email_app_name = "Matrix" self.email_app_name = "Matrix"
self.email_notif_from = email_config.get("notif_from", None) self.email_notif_from = email_config.get("notif_from", None)
# make sure it's valid if self.email_notif_from is not None:
parsed = email.utils.parseaddr(self.email_notif_from) # make sure it's valid
if self.email_notif_from and parsed[1] == '': parsed = email.utils.parseaddr(self.email_notif_from)
raise RuntimeError("Invalid notif_from address") if parsed[1] == '':
raise RuntimeError("Invalid notif_from address")
template_dir = email_config.get("template_dir") template_dir = email_config.get("template_dir")
# we need an absolute path, because we change directory after starting (and # we need an absolute path, because we change directory after starting (and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment