From f58df4820f36bfec3ffad087af275de5c2af7e5d Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 11 Nov 2010 15:44:26 +0530 Subject: [PATCH] [FIX] crm: Corrected handling text/html type emails. Converts html tags to plain text. lp bug: https://launchpad.net/bugs/644325 fixed bzr revid: uco@tinyerp.com-20101111101426-6t71jz3pk8jtyk6a --- addons/mail_gateway/mail_gateway.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index 696c7571cfb..d6bbd59eaaf 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -486,6 +486,8 @@ class mailgate_tool(osv.osv_memory): if not msg_txt.is_multipart() or 'text/plain' in msg.get('Content-Type', ''): encoding = msg_txt.get_content_charset() body = msg_txt.get_payload(decode=True) + if 'text/html' in msg_txt.get('Content-Type', ''): + body = tools.html2plaintext(body) msg['body'] = tools.ustr(body, encoding) attachments = {}