diff options
| author | ced <> | 2007-06-20 05:29:23 +0000 |
|---|---|---|
| committer | ced <> | 2007-06-20 05:29:23 +0000 |
| commit | d6b042ec883744e268e1d7cdb7bbb15c07438947 (patch) | |
| tree | 650fe0af6fb0bb57e1878e8314fb8f00de5ec6bd /addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py | |
| parent | 8bf26e5d80f4d02d631dee3fda54b74e90e4c0bc (diff) | |
CRM: fix mailgate script to be more fault tolerant
bzr revid: ced-5844af190afda33037416682852e2b58f3d1e5c5
Diffstat (limited to 'addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py')
| -rwxr-xr-x | addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py b/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py index f93f387a48d..2796934d079 100755 --- a/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py +++ b/addons/crm/scripts/tinyerp-mailgate/tinyerp-mailgate.py @@ -127,7 +127,9 @@ class email_parser(object): continue if part.get_content_maintype()=='text' and part.get_content_subtype() == 'plain': - message['body'] += part.get_payload(decode=True).decode(part.get_charsets()[0]) + buf = part.get_payload(decode=True) + if buf: + message['body'] += buf.decode(part.get_charsets()[0] or 'ascii', 'replace') elif part.get_content_maintype()=='application' or part.get_content_maintype()=='image' or part.get_content_maintype()=='text': filename = part.get_filename(); if filename : |
