summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2017-08-24 17:46:52 -0400
committerKali Kaneko <kali@leap.se>2017-09-13 18:42:56 +0200
commit6173c99fa3b705814ade642ea4c900b8421283dc (patch)
tree30bf71d330f6eed0bd68f562c80a6399e8803cd5 /src/leap/bitmask/mail
parent8f18e8a0fa96987de25d784f0df6c1066eee104e (diff)
[bug] send UIDNEXT on select
node-mail chokes if we don't.
Diffstat (limited to 'src/leap/bitmask/mail')
-rw-r--r--src/leap/bitmask/mail/imap/server.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/leap/bitmask/mail/imap/server.py b/src/leap/bitmask/mail/imap/server.py
index 9eef6e83..502db773 100644
--- a/src/leap/bitmask/mail/imap/server.py
+++ b/src/leap/bitmask/mail/imap/server.py
@@ -246,10 +246,12 @@ class LEAPIMAPServer(imap4.IMAP4Server):
d1 = defer.maybeDeferred(mbox.getMessageCount)
d2 = defer.maybeDeferred(mbox.getRecentCount)
- return defer.gatherResults([d1, d2]).addCallback(
+ d3 = defer.maybeDeferred(mbox.getUIDNext)
+ return defer.gatherResults([d1, d2, d3]).addCallback(
self.__cbSelectWork, mbox, cmdName, tag)
- def __cbSelectWork(self, ((msg_count, recent_count)), mbox, cmdName, tag):
+ def __cbSelectWork(self, ((msg_count, recent_count, uid_next)),
+ mbox, cmdName, tag):
flags = mbox.getFlags()
self.sendUntaggedResponse('FLAGS (%s)' % ' '.join(flags))
@@ -265,6 +267,10 @@ class LEAPIMAPServer(imap4.IMAP4Server):
self.sendPositiveResponse(
None, '[UIDVALIDITY %d] UIDs valid' % mbox.getUIDValidity())
# ----------------------------------------------------------------
+ # Patched ---------------------------------------------------------
+ # send UIDNEXT too
+ self.sendPositiveResponse(None, '[UIDNEXT %d]' % uid_next)
+ # ----------------------------------------------------------------
s = mbox.isWriteable() and 'READ-WRITE' or 'READ-ONLY'
mbox.addListener(self)