From 0fbe576c44b2e8b327c43f01cad3b9dbca31dea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Fri, 18 Nov 2022 14:30:19 +0100 Subject: [PATCH] Fix: Also replace source mailbox to alias when replacing stuff in the reply phase (#1432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Adrià Casajús --- email_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/email_handler.py b/email_handler.py index 7ab35d58..7c6bf50e 100644 --- a/email_handler.py +++ b/email_handler.py @@ -1125,8 +1125,9 @@ def handle_reply(envelope, msg: Message, rcpt_to: str) -> (bool, str): # as this is usually included when replying if user.replace_reverse_alias: LOG.d("Replace reverse-alias %s by contact email %s", reply_email, contact) - msg = replace(msg, reply_email, contact.website_email) + LOG.d("Replace mailbox %s by alias email %s", mailbox.email, alias.email) + msg = replace(msg, mailbox.email, alias.email) if config.ENABLE_ALL_REVERSE_ALIAS_REPLACEMENT: start = time.time()