[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
This commit is contained in:
uco (OpenERP) 2010-11-11 15:44:26 +05:30
parent eb8bd6581d
commit f58df4820f
1 changed files with 2 additions and 0 deletions

View File

@ -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 = {}