From d2abe6d455a116e0b9cbc0e95a158a7aad9cf8c1 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 27 Apr 2021 15:20:09 +0200 Subject: [PATCH] stages/email: catch ValueError when global email settings are invalid Signed-off-by: Jens Langhammer --- authentik/stages/email/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentik/stages/email/tasks.py b/authentik/stages/email/tasks.py index 38fafdeeb..462f3dae6 100644 --- a/authentik/stages/email/tasks.py +++ b/authentik/stages/email/tasks.py @@ -68,7 +68,7 @@ def send_mail( messages=["Successfully sent Mail."], ) ) - except (SMTPException, ConnectionError) as exc: + except (SMTPException, ConnectionError, ValueError) as exc: LOGGER.debug("Error sending email, retrying...", exc=exc) self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc)) raise exc