summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/leap/bitmask/mail/adaptors/soledad.py1
-rw-r--r--src/leap/bitmask/mail/walk.py1
-rw-r--r--tests/integration/mail/adaptors/test_soledad_adaptor.py2
3 files changed, 4 insertions, 0 deletions
diff --git a/src/leap/bitmask/mail/adaptors/soledad.py b/src/leap/bitmask/mail/adaptors/soledad.py
index 4a8008d6..665cef23 100644
--- a/src/leap/bitmask/mail/adaptors/soledad.py
+++ b/src/leap/bitmask/mail/adaptors/soledad.py
@@ -432,6 +432,7 @@ class ContentDocWrapper(SoledadDocumentWrapper):
content_disposition = ""
content_transfer_encoding = ""
content_type = ""
+ charset = ""
class __meta__(object):
index = "phash"
diff --git a/src/leap/bitmask/mail/walk.py b/src/leap/bitmask/mail/walk.py
index 61bbe0b7..6c9fc382 100644
--- a/src/leap/bitmask/mail/walk.py
+++ b/src/leap/bitmask/mail/walk.py
@@ -79,6 +79,7 @@ def get_raw_docs(msg):
'raw': part.get_payload(),
'phash': get_hash(part.get_payload()),
'content-type': part.get_content_type(),
+ 'charset': part.get_content_charset(),
'content-disposition': first(part.get(
'content-disposition', '').split(';')),
'content-transfer-encoding': part.get(
diff --git a/tests/integration/mail/adaptors/test_soledad_adaptor.py b/tests/integration/mail/adaptors/test_soledad_adaptor.py
index 8d2ebb5a..72b0be8f 100644
--- a/tests/integration/mail/adaptors/test_soledad_adaptor.py
+++ b/tests/integration/mail/adaptors/test_soledad_adaptor.py
@@ -346,6 +346,8 @@ class SoledadMailAdaptorTestCase(SoledadTestMixin):
self.assertEqual(
'text/plain', msg.wrapper.cdocs[1].content_type)
self.assertEqual(
+ 'utf-8', msg.wrapper.cdocs[1].charset)
+ self.assertEqual(
'YSB1dGY4IG1lc3NhZ2U=\n', msg.wrapper.cdocs[1].raw)
def test_get_msg_from_docs(self):