From 63022878d0e93f87c7e866ca143109d9cf1111f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Tue, 13 Aug 2013 15:12:51 -0300 Subject: Ignore empty emails --- mail/changes/bug_dont_fail_on_emtpy_mail | 2 ++ mail/src/leap/mail/imap/fetch.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 mail/changes/bug_dont_fail_on_emtpy_mail diff --git a/mail/changes/bug_dont_fail_on_emtpy_mail b/mail/changes/bug_dont_fail_on_emtpy_mail new file mode 100644 index 0000000..0fc4ffc --- /dev/null +++ b/mail/changes/bug_dont_fail_on_emtpy_mail @@ -0,0 +1,2 @@ + o Do not fail while processing an empty mail, just skip it. Fixes + #3457. \ No newline at end of file diff --git a/mail/src/leap/mail/imap/fetch.py b/mail/src/leap/mail/imap/fetch.py index 9b76592..4a939fd 100644 --- a/mail/src/leap/mail/imap/fetch.py +++ b/mail/src/leap/mail/imap/fetch.py @@ -125,14 +125,15 @@ class LeapIncomingMail(object): # XXX should check for _enc_scheme == "pubkey" || "none" # that is what incoming mail uses. encdata = doc.content[self.ENC_JSON_KEY] - d = defer.Deferred(self._decrypt_msg(doc, encdata)) - d.addCallbacks(self._process_decrypted, log.msg) + defer.Deferred(self._decrypt_msg(doc, encdata)) else: logger.debug('This does not look like a proper msg.') def _decrypt_msg(self, doc, encdata): log.msg('decrypting msg') key = self._pkey + if len(encdata) == 0: + return decrdata = (self._keymanager.decrypt( encdata, key, # XXX get from public method instead -- cgit v1.2.3