diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-12-06 17:32:11 +0000 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-12-06 17:32:11 +0000 |
commit | 4658e8acdbb17c67f3b84e412ee37c810c3af549 (patch) | |
tree | 898087eb5f52bba51106d91cedd8d0711320ab7b /pykolab/imap/__init__.py | |
parent | 56a66d16532896d9b93be9fe0806a8b18a7c2bda (diff) | |
download | pykolab-4658e8acdbb17c67f3b84e412ee37c810c3af549.tar.gz |
Fix "automatic" reconnecting should the connection timeout / cease to exist
Diffstat (limited to 'pykolab/imap/__init__.py')
-rw-r--r-- | pykolab/imap/__init__.py | 6 |
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) |