From bd476d7ba97a479db14a9b72b8b52ef5997d98f6 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 20 Feb 2014 17:07:58 -0400 Subject: Fix regression on "duplicate drafts" issue. Not a permanent solution, but it looks for fdoc matching a given msgid to avoid duplication of drafts in thunderbird folders. --- src/leap/mail/imap/mailbox.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/leap/mail/imap/mailbox.py') diff --git a/src/leap/mail/imap/mailbox.py b/src/leap/mail/imap/mailbox.py index 59b2b40..947cf1b 100644 --- a/src/leap/mail/imap/mailbox.py +++ b/src/leap/mail/imap/mailbox.py @@ -354,7 +354,8 @@ class SoledadMailbox(WithMsgFields, MBoxParser): :rtype: int """ msg = self.messages.get_msg_by_uid(message) - return msg.getUID() + if msg is not None: + return msg.getUID() def getUIDNext(self): """ @@ -854,6 +855,7 @@ class SoledadMailbox(WithMsgFields, MBoxParser): if len(query) > 2: if query[1] == 'HEADER' and query[2].lower() == "message-id": msgid = str(query[3]).strip() + logger.debug("Searching for %s" % (msgid,)) d = self.messages._get_uid_from_msgid(str(msgid)) d1 = defer.gatherResults([d]) # we want a list, so return it all the same -- cgit v1.2.3