From 6aebdc2ab6ff2dec95aae9b2c04f99e70b41fdbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 17 Aug 2016 17:18:17 +0200 Subject: [PATCH] [FIX][IMP] mail: check for rcptto when finding destination aliases When a new answer comes in a thread the mailgateway finds if the recipients are linked to existing aliases. This allows notably to check if the author can effectively contact this alias. Previously only the To was checked. However we cannot ensure the recipient is contained in To as it could be in Delivered-To for example. We now check for all possible recipients. --- addons/mail/models/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index fe15cc9c466..d59ed690445 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1032,7 +1032,7 @@ class MailThread(models.AbstractModel): if mail_messages: model, thread_id = mail_messages.model, mail_messages.res_id if not reply_private: # TDE note: not sure why private mode as no alias search, copying existing behavior - dest_aliases = Alias.search([('alias_name', '=', email_to_localpart)], limit=1) + dest_aliases = Alias.search([('alias_name', 'in', rcpt_tos_localparts)], limit=1) # TDE Note: compat mode = without context key, why ? because route = self.message_route_verify(