summaryrefslogtreecommitdiff
path: root/src/leap/mx
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-04-25 15:31:09 -0300
committerTomas Touceda <chiiph@leap.se>2013-04-25 15:31:09 -0300
commitc1eec313e873c9e2567db6798ef07f58953145da (patch)
tree2fbad2b8461f4ae0eb156cb222a0a559b4ab0e25 /src/leap/mx
parentfacf49f24fa54a67ec52846e9e0f49bf0b50bc41 (diff)
Add incoming tag to unencrypted data too
Diffstat (limited to 'src/leap/mx')
-rw-r--r--src/leap/mx/mail_receiver.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py
index 20b5f4a..00d93ba 100644
--- a/src/leap/mx/mail_receiver.py
+++ b/src/leap/mx/mail_receiver.py
@@ -53,9 +53,11 @@ def _encrypt_message(uuid_pubkey, address_message):
doc = LeapDocument(encryption_scheme=EncryptionSchemes.PUBKEY,
doc_id=str(pyuuid.uuid4()))
+ data = {'incoming': True, 'content': message}
+
if pubkey is None or len(pubkey) == 0:
doc.content = {
- "_unencrypted_json": message
+ "_unencrypted_json": json.dumps(data)
}
return uuid, doc
@@ -65,8 +67,6 @@ def _encrypt_message(uuid_pubkey, address_message):
openpgp_key = openpgp._safe_call(_ascii_to_openpgp_cb, pubkey)
- data = {'incoming': True, 'content': message}
-
doc.content = {
"_encrypted_json": openpgp.encrypt_asym(json.dumps(data), openpgp_key)
}