Openerp5下poweremail5乱码问题(分享)
-
查找核心文件 server/addons/poweremail/poweremail_core.py,调整关联项
//邮件标题乱码处理
h = email.Header.Header(mail['subject'])
dh = email.Header.decode_header(h)
subject = dh[0][0]
//收、发人地址乱码处理
vals = {
'pem_from':email.utils.parseaddr(mail['From'])[1],
'pem_to':email.utils.parseaddr(mail['To'])[1] or 'no recepient',
....
}
//附件名乱码处理
tools.ustr(email.Header.decode_header(part.get_filename())[0][0]),
//内容乱码处理
parsed_mail['text'] = tools.ustr(part.get_payload(decode=True))