From dd591c7437d0cd9e5607b5a65d57f593e0586a02 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Wed, 2 Jun 2021 16:27:48 +0200 Subject: [PATCH] fix --- email_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/email_handler.py b/email_handler.py index a9e3cff4..8eda27f7 100644 --- a/email_handler.py +++ b/email_handler.py @@ -1597,7 +1597,11 @@ def handle(envelope: Envelope) -> str: return handle_bounce(envelope, email_log, msg) # iCloud returns the bounce with mail_from=bounce+{email_log_id}+@simplelogin.co, rcpt_to=alias - if len(rcpt_tos) == 1 and mail_from.startswith(BOUNCE_PREFIX): + if ( + len(rcpt_tos) == 1 + and mail_from.startswith(BOUNCE_PREFIX) + and mail_from.endswith(BOUNCE_SUFFIX) + ): email_log_id = parse_id_from_bounce(mail_from) email_log = EmailLog.get(email_log_id) alias = Alias.get_by(email=rcpt_tos[0])