diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index ac4a1b8ae9c..2a5d2e2a4fd 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -468,6 +468,8 @@ class mail_thread(osv.AbstractModel): # 1. Verify if this is a reply to an existing thread thread_references = references or in_reply_to ref_match = thread_references and tools.reference_re.search(thread_references) + use_email_to = thread_references and tools.use_email_to_re.search(thread_references) + if ref_match: thread_id = int(ref_match.group(1)) model = ref_match.group(2) or model @@ -479,7 +481,7 @@ class mail_thread(osv.AbstractModel): return [(model, thread_id, custom_values, uid)] # Verify whether this is a reply to a private message - if in_reply_to: + if in_reply_to and not use_email_to: message_ids = self.pool.get('mail.message').search(cr, uid, [('message_id', '=', in_reply_to)], limit=1, context=context) if message_ids: message = self.pool.get('mail.message').browse(cr, uid, message_ids[0], context=context)