summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-12-06 17:32:11 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-12-06 17:32:11 +0000
commit4658e8acdbb17c67f3b84e412ee37c810c3af549 (patch)
tree898087eb5f52bba51106d91cedd8d0711320ab7b /pykolab/imap
parent56a66d16532896d9b93be9fe0806a8b18a7c2bda (diff)
downloadpykolab-4658e8acdbb17c67f3b84e412ee37c810c3af549.tar.gz
Fix "automatic" reconnecting should the connection timeout / cease to exist
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py6
1 files changed, 5 insertions, 1 deletions
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)