From 0abfb82fd10b79de027ec33df9fc10f8f67bd7dd Mon Sep 17 00:00:00 2001 From: Son Date: Wed, 5 Jan 2022 15:20:17 +0100 Subject: [PATCH] investigate emails sent to reverse alias from <> --- email_handler.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/email_handler.py b/email_handler.py index 3b07587c..80a04e6b 100644 --- a/email_handler.py +++ b/email_handler.py @@ -2169,10 +2169,14 @@ def handle(envelope: Envelope) -> str: else: return status.E522 - # Handle "out of office" auto notice, i.e. an automatic response is sent for every forwarded email + # Handle "out-of-office" auto notice, i.e. an automatic response is sent for every forwarded email if len(rcpt_tos) == 1 and is_reverse_alias(rcpt_tos[0]) and mail_from == "<>": + contact = Contact.get_by(reply_email=rcpt_tos[0]) LOG.w( - "out-of-office email to reverse alias %s. %s", rcpt_tos[0], msg.as_string() + "out-of-office email to reverse alias %s. %s %s", + contact, + msg.as_string(), + save_email_for_debugging(msg), # todo: remove ) return status.E206