0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-06-15 00:58:22 +02:00

Only parse from email if provided

This commit is contained in:
Brendan Abolivier 2019-06-04 14:24:36 +01:00
parent 1cc5fc1f6c
commit 2f62e1f6ff
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD

View file

@ -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