From 17ec4df02a8d1440aac5634b2516555a5f841046 Mon Sep 17 00:00:00 2001 From: James Bunton Date: Tue, 10 Feb 2009 16:19:55 +1100 Subject: [PATCH] Added check for IDLE in capabilities --- offlineimap/imapserver.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index f295743..c850e99 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -401,8 +401,8 @@ class IdleThread(object): def noop(self): imapobj = self.parent.acquireconnection() - self.event.wait() imapobj.noop() + self.event.wait() self.parent.releaseconnection(imapobj) def dosync(self): @@ -429,7 +429,10 @@ class IdleThread(object): self.needsync = True self.event.set() imapobj = self.parent.acquireconnection() - imapobj.idle(callback=callback) + if "IDLE" in imapobj.capabilities: + imapobj.idle(callback=callback) + else: + imapobj.noop() self.event.wait() if self.event.isSet(): imapobj.noop()