diff options
author | Kali Kaneko <kali@leap.se> | 2013-12-27 02:06:44 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2014-01-08 20:32:08 -0400 |
commit | 25a0aea875fd0d67238beed1237f7239474673ec (patch) | |
tree | afafe7eb7e18acf6420c29b88a8678070e997bcd /src/leap/mail/imap/fetch.py | |
parent | 62b0cd6301b7097dfa2776b677ab3c7d27f60d7b (diff) |
First stage of the storage schema rewrite.
* Separates between flags, docs, body and attachment docs.
* Implement IMessageCopier interface: move and have fun!
This little change is known to push forward our beloved architect
emotional rollercoster.
* Message deduplication.
* It also fixes a hidden bug that was rendering the multipart mime
interface useless
(yes, the "True" parameter in the parsestr method).
* Does not handle well nested attachs, includes dirty workaround that
flattens them.
* Includes chiiph's patch for rc2:
* return deferred from addMessage
* convert StringIO types to string
* remove unneeded yields from the chain of deferreds in fetcher
Diffstat (limited to 'src/leap/mail/imap/fetch.py')
-rw-r--r-- | src/leap/mail/imap/fetch.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/leap/mail/imap/fetch.py b/src/leap/mail/imap/fetch.py index 0b31c3b..fdf1412 100644 --- a/src/leap/mail/imap/fetch.py +++ b/src/leap/mail/imap/fetch.py @@ -412,13 +412,13 @@ class LeapIncomingMail(object): # decrypt or fail gracefully try: - decrdata, valid_sig = yield self._decrypt_and_verify_data( + decrdata, valid_sig = self._decrypt_and_verify_data( encdata, senderPubkey) except keymanager_errors.DecryptError as e: logger.warning('Failed to decrypt encrypted message (%s). ' 'Storing message without modifications.' % str(e)) # Bailing out! - yield (msg, False) + return (msg, False) # decrypted successully, now fix encoding and parse try: @@ -441,7 +441,7 @@ class LeapIncomingMail(object): # all ok, replace payload by unencrypted payload msg.set_payload(decrmsg.get_payload()) - yield (msg, valid_sig) + return (msg, valid_sig) def _maybe_decrypt_inline_encrypted_msg(self, origmsg, encoding, senderPubkey): @@ -527,6 +527,7 @@ class LeapIncomingMail(object): """ log.msg('adding message to local db') doc, data = msgtuple + if isinstance(data, list): data = data[0] |