From 068df7d0260ac043cbfd0cde8ff955acc5749649 Mon Sep 17 00:00:00 2001 From: Nicolas Sebrecht Date: Wed, 19 Jan 2011 19:55:10 +0100 Subject: [PATCH 1/2] README: don't use github features for contributions Display the warning ASAP to help not wasting time for newcomers. All kind of contributions are expected at the mailing lists to bring posts a wider audience. Signed-off-by: Nicolas Sebrecht --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 47cb2a8..b4bdccc 100644 --- a/README.rst +++ b/README.rst @@ -147,13 +147,15 @@ The user discussion, development and all exciting stuff take place in the `mailing list`_. You're *NOT* supposed to subscribe to send emails. -Reporting bugs -============== +Reporting bugs and contributions +================================ Bugs ---- -Bugs and issues should be reported to the `mailing list`_. +Bugs, issues and contributions should be reported to the `mailing list`_. +**Please, don't use the github features (messages, pull requests, etc) at all. +It would most likely be discarded or ignored.** ======== From 9ad1810e43e1f7ef1b04ac0252bcaffa564dce4e Mon Sep 17 00:00:00 2001 From: Knut Anders Hatlen Date: Thu, 20 Jan 2011 20:02:38 +0100 Subject: [PATCH 2/2] understand multiple EXISTS replies from servers like Zimbra Lars Thalmann writes: > It seems some servers (Zimbra?) respond to imap SELECT requests with > multiple EXISTS lines: > > ? SELECT INBOX > * 500 EXISTS > * 0 RECENT > * 1000 EXISTS > * 0 RECENT > * 1500 EXISTS > * 0 RECENT > * 1567 EXISTS > * 0 RECENT Signed-off-by: Knut Anders Hatlen Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/IMAP.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 927c5f4..be96d5f 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -85,9 +85,13 @@ class IMAPFolder(BaseFolder): # Primes untagged_responses imapobj.select(self.getfullname(), readonly = 1, force = 1) try: - # Some mail servers do not return an EXISTS response if - # the folder is empty. - maxmsgid = long(imapobj.untagged_responses['EXISTS'][0]) + # 1. Some mail servers do not return an EXISTS response + # if the folder is empty. 2. ZIMBRA servers can return + # multiple EXISTS replies in the form 500, 1000, 1500, + # 1623 so check for potentially multiple replies. + maxmsgid = 0 + for msgid in imapobj.untagged_responses['EXISTS']: + maxmsgid = max(long(msgid), maxmsgid) except KeyError: return True @@ -167,10 +171,13 @@ class IMAPFolder(BaseFolder): return else: try: - # Some mail servers do not return an EXISTS response if - # the folder is empty. - - maxmsgid = long(imapobj.untagged_responses['EXISTS'][0]) + # 1. Some mail servers do not return an EXISTS response + # if the folder is empty. 2. ZIMBRA servers can return + # multiple EXISTS replies in the form 500, 1000, 1500, + # 1623 so check for potentially multiple replies. + maxmsgid = 0 + for msgid in imapobj.untagged_responses['EXISTS']: + maxmsgid = max(long(msgid), maxmsgid) messagesToFetch = '1:%d' % maxmsgid; except KeyError: return