summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/leap/bitmask/core/configurable.py3
-rw-r--r--src/leap/bitmask/mail/imap/server.py10
-rw-r--r--tests/integration/mail/imap/test_imap.py6
3 files changed, 13 insertions, 6 deletions
diff --git a/src/leap/bitmask/core/configurable.py b/src/leap/bitmask/core/configurable.py
index 5a9e5c9..b2e473a 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 9eef6e8..502db77 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)
diff --git a/tests/integration/mail/imap/test_imap.py b/tests/integration/mail/imap/test_imap.py
index ea86125..82e416e 100644
--- a/tests/integration/mail/imap/test_imap.py
+++ b/tests/integration/mail/imap/test_imap.py
@@ -460,7 +460,8 @@ class LEAPIMAP4ServerTestCase(IMAP4HelperMixin):
self.assertTrue(self.selectedArgs is not None)
self.assertEqual(self.selectedArgs, {
- 'EXISTS': 0, 'RECENT': 0, 'UIDVALIDITY': 42,
+ 'EXISTS': 0, 'RECENT': 0, 'UIDNEXT': 1,
+ 'UIDVALIDITY': 42,
'FLAGS': ('\\Seen', '\\Answered', '\\Flagged',
'\\Deleted', '\\Draft', '\\Recent', 'List'),
'READ-WRITE': True
@@ -668,7 +669,8 @@ class LEAPIMAP4ServerTestCase(IMAP4HelperMixin):
def _cbTestExamine(self, ignored):
self.assertEqual(self.examinedArgs, {
- 'EXISTS': 0, 'RECENT': 0, 'UIDVALIDITY': 42,
+ 'EXISTS': 0, 'RECENT': 0, 'UIDNEXT': 1,
+ 'UIDVALIDITY': 42,
'FLAGS': ('\\Seen', '\\Answered', '\\Flagged',
'\\Deleted', '\\Draft', '\\Recent', 'List'),
'READ-WRITE': False})