From e8b633b88459db3512e85d444a95f283c254a5f9 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 6 Jun 2011 23:21:47 +0200 Subject: [PATCH] folder/IMAP: Remove buggy duplicate assignment we do: for msgid in imapdata: maxmsgid = max(long(msgid), maxmsgid) and then basically immediately: maxmsgid = long(imapdata[0]) throwing away the first assignment although the first method of assigning is the correct one. The second had been forgotten to be removed when we introduced the above iteration. This bug would fix a regression with those broken ZIMBRA servers that send multiple EXISTS replies. Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/IMAP.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 8dfca7a..8851b5b 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -164,13 +164,11 @@ class IMAPFolder(BaseFolder): maxmsgid = 0 for msgid in imapdata: maxmsgid = max(long(msgid), maxmsgid) - - maxmsgid = long(imapdata[0]) - messagesToFetch = '1:%d' % maxmsgid; - if maxmsgid < 1: #no messages; return return + messagesToFetch = '1:%d' % maxmsgid; + # Now, get the flags and UIDs for these. # We could conceivably get rid of maxmsgid and just say # '1:*' here.