don't report "Internal Server Error" if mail already exists
All checks were successful
/ test (push) Successful in 2m50s
/ deploy (push) Successful in 7m3s

This commit is contained in:
j3d1 2025-01-20 19:43:01 +01:00
parent 4ea74637a3
commit fbbf8352cf

View file

@ -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