summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2016-08-17 17:18:17 +0200
committerThibault Delavallée <tde@openerp.com>2016-09-01 12:50:14 +0200
commit6aebdc2ab6ff2dec95aae9b2c04f99e70b41fdbe (patch)
tree44700bab6e34cca234e349b9bd360389353f4397
parent0028c42136f02fcb7a9a81ed5763396290ffdcb8 (diff)
[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.
-rw-r--r--addons/mail/models/mail_thread.py2
1 files changed, 1 insertions, 1 deletions
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(