server/facade: Check mailer config on startup

This commit is contained in:
Shyam Sunder 2019-07-22 19:51:22 -04:00
parent 80d272d60b
commit 9a9a475037

View file

@ -91,6 +91,20 @@ def validate_config() -> None:
if not config.config['database']: if not config.config['database']:
raise errors.ConfigError('Database is not configured') raise errors.ConfigError('Database is not configured')
if config.config['smtp']['host']:
if not config.config['smtp']['port']:
raise errors.ConfigError(
'SMTP host is set but port is not set')
if not config.config['smtp']['user']:
raise errors.ConfigError(
'SMTP host is set but username is not set')
if not config.config['smtp']['pass']:
raise errors.ConfigError(
'SMTP host is set but password is not set')
if not config.config['smtp']['from']:
raise errors.ConfigError(
'From address must be set to use mail-based password reset')
def purge_old_uploads() -> None: def purge_old_uploads() -> None:
while True: while True: