summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/mailbox.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-02-20 17:07:58 -0400
committerKali Kaneko <kali@leap.se>2014-02-20 17:07:58 -0400
commitbd476d7ba97a479db14a9b72b8b52ef5997d98f6 (patch)
tree634a58e84cc68e87a39a35a28f01ae050e1b2d82 /src/leap/mail/imap/mailbox.py
parenta25e73b402d73eea03a7bf34c863a98577c78ace (diff)
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.
Diffstat (limited to 'src/leap/mail/imap/mailbox.py')
-rw-r--r--src/leap/mail/imap/mailbox.py4
1 files changed, 3 insertions, 1 deletions
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