[PATCH 4/6] Re: Add check for IDLE in capabilities

Nicolas Sebrecht nicolas.s-dev at laposte.net
Wed May 18 18:27:04 BST 2011


On Wed, May 18, 2011 at 08:48:55AM -0400, Ethan Glasser-Camp wrote:
> 
> If the server doesn't support IDLE, we fall back to the standard
> noop() keepalive.
> 
> This commit was originally by James Bunton <jamesbunton at fastmail.fm>.
> 
> Signed-off-by: Ethan Glasser-Camp <ethan at betacantrips.com>
> ---
>  offlineimap/imapserver.py |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py
> index ceea3dc..5f697b7 100644
> --- a/offlineimap/imapserver.py
> +++ b/offlineimap/imapserver.py
> @@ -412,7 +412,10 @@ class IdleThread(object):
>                      self.event.set()
>              imapobj = self.parent.acquireconnection()
>              imapobj.select(self.folder)
> -            imapobj.idle(callback=callback)
> +            if "IDLE" in imapobj.capabilities:
> +                imapobj.idle(callback=callback)
> +            else:
> +                imapobj.noop()

We should do more than a silent check. Users still expect IDLE to work.
Or did I missed anything else warning users?

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list