From a7d4bd15a702f900be0346efd6cbd747659504a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Mon, 4 Mar 2024 17:47:06 +0100 Subject: [PATCH] If the transactional_id is None do nothing --- email_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/email_handler.py b/email_handler.py index ce55249d5..c9d0ad237 100644 --- a/email_handler.py +++ b/email_handler.py @@ -1891,6 +1891,11 @@ def handle_transactional_bounce( envelope: Envelope, msg, rcpt_to, transactional_id=None ): LOG.d("handle transactional bounce sent to %s", rcpt_to) + if transactional_id is None: + LOG.i( + f"No transactional record for {envelope.mail_from} -> {envelope.rcpt_tos}" + ) + return transactional = TransactionalEmail.get(transactional_id) # a transaction might have been deleted in delete_logs()