From 4c406f5afc04c14da9d3c845d0e251ddbcd65cb4 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 5 Jun 2019 15:13:23 +0100 Subject: [PATCH] Revert "Modify check for smtp settings to be kinder to CI" This reverts commit 6d2d3c9fd3fb5cf2f954cc9ec0929832a3112124. --- synapse/config/emailconfig.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/synapse/config/emailconfig.py b/synapse/config/emailconfig.py index 82ff9f9360..df1384a7d6 100644 --- a/synapse/config/emailconfig.py +++ b/synapse/config/emailconfig.py @@ -95,15 +95,22 @@ class EmailConfig(Config): bleach if not self.email_enable_password_reset_from_is: - if ( - not self.email_smtp_host - or not self.email_smtp_port - or not self.email_notif_from - ): + required = [ + "smtp_host", + "smtp_port", + "notif_from", + ] + + missing = [] + for k in required: + if k not in email_config: + missing.append(k) + + if (len(missing) > 0): raise RuntimeError( "email.enable_password_reset_from_is is False " - "but not all of the following are set: " - "email.smtp_host, email.smtp_port, email_notif_from" + "but required keys are missing: %s" % + (", ".join(["email." + k for k in missing]),) ) # Templates for password reset emails