[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.
This commit is contained in:
Thibault Delavallée
2016-09-01 12:50:14 +02:00
parent 0028c42136
commit 6aebdc2ab6
+1 -1
View File
@@ -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(