From: W. Trevor King Date: Tue, 21 Jul 2009 17:24:55 +0000 (-0400) Subject: be-mbox-to-xml handles emails without explicit transfer encodings. X-Git-Tag: 1.0.0~63^2~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ec21c8cae10abf14dd429eee484af8dd0b1c4c24;p=be.git be-mbox-to-xml handles emails without explicit transfer encodings. --- diff --git a/interfaces/xml/be-mbox-to-xml b/interfaces/xml/be-mbox-to-xml index 840a2a6..75cfd2b 100755 --- a/interfaces/xml/be-mbox-to-xml +++ b/interfaces/xml/be-mbox-to-xml @@ -74,7 +74,10 @@ def comment_message_to_xml(message, fields=None): #assert charset == DEFAULT_ENCODING.lower(), \ # u"Unknown charset: %s" % charset - encoding = message[u'content-transfer-encoding'].lower() + if message[u'content-transfer-encoding'] == None: + encoding = DEFAULT_ENCODING + else: + encoding = message[u'content-transfer-encoding'].lower() body = message.get_payload(decode=True) # attempt to decode assert body != None, "Unable to decode?" if fields[u'content-type'].startswith(u"text/"):