diff options
Diffstat (limited to 'src/leap/mx/mail_receiver.py')
-rw-r--r-- | src/leap/mx/mail_receiver.py | 6 |
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) } |