Only parse from email if provided
This commit is contained in:
parent
1cc5fc1f6c
commit
2f62e1f6ff
|
@ -51,9 +51,10 @@ 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)
|
||||||
|
if self.email_notif_from is not None:
|
||||||
# make sure it's valid
|
# make sure it's valid
|
||||||
parsed = email.utils.parseaddr(self.email_notif_from)
|
parsed = email.utils.parseaddr(self.email_notif_from)
|
||||||
if self.email_notif_from and parsed[1] == '':
|
if parsed[1] == '':
|
||||||
raise RuntimeError("Invalid notif_from address")
|
raise RuntimeError("Invalid notif_from address")
|
||||||
|
|
||||||
template_dir = email_config.get("template_dir")
|
template_dir = email_config.get("template_dir")
|
||||||
|
|
Loading…
Reference in New Issue