be-mbox-to-xml handles emails without explicit transfer encodings.
authorW. Trevor King <wking@drexel.edu>
Tue, 21 Jul 2009 17:24:55 +0000 (13:24 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 21 Jul 2009 17:24:55 +0000 (13:24 -0400)
interfaces/xml/be-mbox-to-xml

index 840a2a62603c4b795d6ada8db8fc7697fbf496fb..75cfd2bc74524304ca99651b99128501ab559221 100755 (executable)
@@ -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/"):