+.. -*-Mode: rst; -*-
+
=====
Dev
=====
instead of command line arguments. See livetest-sample.ini for an
example.
-Added NAMESPACE support (#63)
------------------------------
+Added NAMESPACE support (#63) [API CHANGE]
+------------------------------------------
namespace() method added and get_folder_delimiter() has been deprecated.
+Added support for FETCH modifiers (#62) [NEW]
+---------------------------------------------
+The fetch method now takes optional modifiers as the last
+argument. These are required for extensions such as RFC 4551
+(conditional store). Thanks to Thomas Jost for the patch.
+
===============
Version 0.6.2
===============
IMAPClient is distributed with Michael's excellent mock.py
(http://www.voidspace.org.uk/python/mock/)
-Mark Hammond <mhammond _AT_ skipinet.com.au)
- Much work related to response parsing.
+Mark Hammond (mhammond _AT_ skipinet.com.au)
+ Much work related to response parsing and many bug reports.
+
+Thomas Jost (schnouki _AT_ schnouki.net)
+ FETCH modifiers patch.
Bug Reports
@param messages: Message IDs to fetch.
@param parts: A sequence of data items to retrieve.
- @param modifiers: An optional sequence of modifiers.
+ @param modifiers: An optional sequence of modifiers (where
+ supported by the server, eg. ['CHANGEDSINCE 123']).
@return: A dictionary indexed by message number. Each item is itself a
dictionary containing the requested message parts.
INTERNALDATE parts will be returned as datetime objects converted
self.assertEqual(len(body), 25)
self.assertTrue(body.startswith('om: Bob Smith'))
+
+ def test_fetch_modifiers(self):
+ # CONDSTORE (RFC 4551) provides a good way to use FETCH
+ # modifiers but it isn't commonly available.
+ if not self.client.has_capability('CONDSTORE'):
+ return self.skipTest("Server doesn't support CONDSTORE")
+
+ maxModSeq = int(self.client.select_folder('INBOX')['HIGHESTMODSEQ'][0])
+ self.client.append('INBOX', SIMPLE_MESSAGE)
+ msg_id = self.client.search()[0]
+
+ resp = self.client.fetch(msg_id, ['FLAGS'], ['CHANGEDSINCE %d' % maxModSeq])
+ msg_info = resp[msg_id]
+ self.assertIn('MODSEQ', msg_info)
+
+ # Prove that the modifier is actually being used
+ resp = self.client.fetch(msg_id, ['FLAGS'], ['CHANGEDSINCE %d' % (maxModSeq + 1)])
+ self.assertFalse(resp)
+
+
def test_BODYSTRUCTURE(self):
self.client.select_folder('INBOX')
self.client.append('INBOX', SIMPLE_MESSAGE)