diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 373efb6eead..9fd6652da09 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1370,6 +1370,9 @@ class MailThread(models.AbstractModel): if message.get_content_type() == 'text/plain': # text/plain ->
body = tools.append_content_to_html('', body, preserve=True) + elif message.get_content_type() == 'text/html': + # we only strip_classes here everything else will be done in by html field of mail.message + body = tools.html_sanitize(body, sanitize_tags=False, strip_classes=True) else: alternative = False mixed = False diff --git a/addons/test_mail/data/test_mail_data.py b/addons/test_mail/data/test_mail_data.py index c823fa60888..c2e6fdb0454 100644 --- a/addons/test_mail/data/test_mail_data.py +++ b/addons/test_mail/data/test_mail_data.py @@ -105,6 +105,36 @@ Please call me as soon as possible this afternoon! Sylvie """ +MAIL_TEMPLATE_HTML = """Return-Path: {return_path} +To: {to} +cc: {cc} +Received: by mail1.openerp.com (Postfix, from userid 10002) + id 5DF9ABFB2A; Fri, 10 Aug 2012 16:16:39 +0200 (CEST) +From: {email_from} +Subject: {subject} +MIME-Version: 1.0 +Content-Type: text/html; charset=utf-8 +Content-Transfer-Encoding: quoted-printable +Date: Fri, 10 Aug 2012 14:16:26 +0000 +Message-ID: {msg_id} +{extra} + + + + =20 + + =20 + =20 + +Please call me as soon as possible this afternoon!
+ +--
+ Sylvie
+
+
+
+"""
+
MAIL_MULTIPART_MIXED = """Return-Path: Please call me as soon as possible this afternoon!