[PATCH] Sort message UID list

Rasmus rasmus at gmx.us
Mon Jul 23 20:10:23 BST 2012


corvus at gnu.org (James E. Blair) writes:

> 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 <corvus at gnu.org>
> ---
>  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 6f6f364..1052552 100644
> --- a/offlineimap/folder/Base.py
> +++ b/offlineimap/folder/Base.py
> @@ -181,7 +181,7 @@ class BaseFolder(object):
>      def getmessageuidlist(self):
>          """Gets a list of UIDs.
>          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."""

I can confirm that this patch makes sure that my mails are not messed up
by OfflineIMAP, even when it re-uploads everything.  Thus, I would very
much like if this patch adopted.

I'm still not sure how to fix the damage OfflineIMAP created the last
time it reuploaded a whole folder...

–Rasmus

-- 
When in doubt, do it!





More information about the OfflineIMAP-project mailing list