diff --git a/Changelog.rst b/Changelog.rst index 781e252..0b485ee 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -17,6 +17,8 @@ OfflineIMAP v6.5.6.1 (YYYY-MM-DD) * Various fixes in documentation. +* Fix unbounded recursion during flag update (Josh Berry). + OfflineIMAP v6.5.6 (2014-05-14) =============================== diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 05e0a36..e317baf 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -801,9 +801,9 @@ class IMAPFolder(BaseFolder): def __processmessagesflags(self, operation, uidlist, flags): # Hack for those IMAP servers with a limited line length batch_size = 100 - while len(uidlist): - self.__processmessagesflags_real(operation, uidlist[:batch_size], flags) - uidlist = uidlist[batch_size:] + for i in xrange(0, len(uidlist), batch_size): + self.__processmessagesflags_real(operation, + uidlist[i:i + batch_size], flags) return