From a5ea1827fbc6211d575cd987ea573565d28ff066 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 7 Jul 2012 20:16:56 -0700 Subject: [PATCH] folder: Base: sort message UID list Return a sorted list of UIDs in getmessageuidlist. Some MUAs (and their users) like to display messages in UID order (or "order received"). If offlineimap is used in IMAP<->IMAP mode, then the order messages are received by the second IMAP server will be different because offlineimap iterates over a UID list produced from the keys of a dictionary, which is unsorted. This change sorts that list of UIDs so that both IMAP servers will have their messages in the same order (except those times where messages are appended to folders on both repositories between syncs). Signed-off-by: James E. Blair Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index e1b0e6d..11fafe4 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -302,7 +302,7 @@ class BaseFolder(object): You may have to call cachemessagelist() before calling this function!""" - return self.getmessagelist().keys() + return sorted(self.getmessagelist().keys()) def getmessagecount(self): """Gets the number of messages."""