From fbbf8352cf9fdfe0af06c1b8df1ab92ae4832b50 Mon Sep 17 00:00:00 2001 From: jedi Date: Mon, 20 Jan 2025 19:43:01 +0100 Subject: [PATCH] don't report "Internal Server Error" if mail already exists --- core/mail/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mail/protocol.py b/core/mail/protocol.py index 3639989..8fa2c3b 100644 --- a/core/mail/protocol.py +++ b/core/mail/protocol.py @@ -220,7 +220,7 @@ def receive_email(envelope, log=None): if Email.objects.filter(reference=header_message_id).exists(): # break before issue thread is created log.warning("Email already exists") - raise Exception("Email already exists") + raise SpecialMailException("Email already exists") recipient = envelope.rcpt_tos[0].lower() if envelope.rcpt_tos else header_to.lower() sender = envelope.mail_from if envelope.mail_from else header_from