summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/leap/mx/mail_receiver.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py
index 9006471..20b5f4a 100644
--- a/src/leap/mx/mail_receiver.py
+++ b/src/leap/mx/mail_receiver.py
@@ -50,13 +50,15 @@ def _encrypt_message(uuid_pubkey, address_message):
logger.debug("Encrypting message to %s's pubkey" % (uuid,))
logger.debug("Pubkey: %s" % (pubkey,))
- if pubkey is None or len(pubkey) == 0:
- logger.exception("No public key found")
- raise Exception("No public key found")
-
doc = LeapDocument(encryption_scheme=EncryptionSchemes.PUBKEY,
doc_id=str(pyuuid.uuid4()))
+ if pubkey is None or len(pubkey) == 0:
+ doc.content = {
+ "_unencrypted_json": message
+ }
+ return uuid, doc
+
def _ascii_to_openpgp_cb(gpg):
key = gpg.list_keys().pop()
return openpgp._build_key_from_gpg(address, key, pubkey)