server/facade: Check mailer config on startup
This commit is contained in:
parent
80d272d60b
commit
9a9a475037
1 changed files with 14 additions and 0 deletions
|
@ -91,6 +91,20 @@ def validate_config() -> None:
|
|||
if not config.config['database']:
|
||||
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:
|
||||
while True:
|
||||
|
|
Loading…
Reference in a new issue