diff --git a/addons/mail/mail_mail.py b/addons/mail/mail_mail.py index 62c1a9fff19..1398e00255b 100644 --- a/addons/mail/mail_mail.py +++ b/addons/mail/mail_mail.py @@ -88,18 +88,16 @@ class mail_mail(osv.Model): """ if values.get('reply_to'): return values.get('reply_to') - redirect_gateway = True # whether replies will be redirected inside the document - - # email_reply_to, model, res_id: comes from values OR related message + format_name = True # whether to use a 'Followers of Pigs reply_to will be the email_from, only the email part + # no alias reply_to -> reply_to will be the email_from if not email_reply_to and email_from: - emails = tools.email_split(email_from) - if emails: - email_reply_to = emails[0] + email_reply_to = email_from # format 'Document name ' - if email_reply_to and model and res_id and redirect_gateway: + if email_reply_to and model and res_id and format_name: + emails = tools.email_split(email_reply_to) + if emails: + email_reply_to = emails[0] document_name = self.pool[model].name_get(cr, SUPERUSER_ID, [res_id], context=context)[0] if document_name: # sanitize document name