From 6173c99fa3b705814ade642ea4c900b8421283dc Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 24 Aug 2017 17:46:52 -0400 Subject: [bug] send UIDNEXT on select node-mail chokes if we don't. --- src/leap/bitmask/core/configurable.py | 3 +-- src/leap/bitmask/mail/imap/server.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/leap/bitmask') diff --git a/src/leap/bitmask/core/configurable.py b/src/leap/bitmask/core/configurable.py index 5a9e5c94..b2e473a7 100644 --- a/src/leap/bitmask/core/configurable.py +++ b/src/leap/bitmask/core/configurable.py @@ -46,8 +46,7 @@ class ConfigurableService(service.MultiService): return self.cfg.get_section(section) -DEFAULT_CONFIG = """ -[services] +DEFAULT_CONFIG = """[services] mail = True vpn = True zmq = True 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) -- cgit v1.2.3