From 4658e8acdbb17c67f3b84e412ee37c810c3af549 Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Kolab Systems)" Date: Tue, 6 Dec 2011 17:32:11 +0000 Subject: Fix "automatic" reconnecting should the connection timeout / cease to exist --- pykolab/imap/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py index 3d6adf7..c22c370 100644 --- a/pykolab/imap/__init__.py +++ b/pykolab/imap/__init__.py @@ -129,7 +129,11 @@ class IMAP(object): self.connect(uri=uri) else: try: - self._imap[hostname].noop() + if hasattr(self._imap[hostname], 'm'): + self._imap[hostname].m.noop() + elif hasattr(self._imap[hostname], 'noop') and callable(self._imap[hostname].noop): + self._imap[hostname].noop() + log.debug(_("Reusing existing IMAP server connection to %s") %(hostname), level=8) except: log.debug(_("Reconnecting to IMAP server %s") %(hostname), level=8) -- cgit v1.1