summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-14 13:18:12 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-15 16:20:24 +0100
commit22035823051733b2a5f74b10610139ceaadde421 (patch)
tree7e221cf398df84e0fe6d7def833dad23e53957ea
parente771aa6abbc258c13772211028dcdf525cab4ba9 (diff)
downloadpykolab-22035823051733b2a5f74b10610139ceaadde421.tar.gz
Verbose logging about the tests we execute to see if a user needs to be subscribed to a particular (additional) folder.
Attempt to subscribe, but fail without a traceback should subscribing not succeed. Verbose logging on the server address found for a mailbox, for the purpose of troubleshooting deployments that exploit case-sensitivity of server addresses. Conflicts: pykolab/imap/__init__.py
-rw-r--r--pykolab/imap/__init__.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 15eca90..ffba13d 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -468,6 +468,10 @@ class IMAP(object):
for _shared in shared:
_tests.append(_shared)
+ log.debug(_("Using the following tests for folder subscriptions:"), level=8)
+ for _test in _tests:
+ log.debug(_(" %r") % (_test), level=8)
+
for _folder in self.lm():
log.debug(_("Folder %s") % (_folder), level=8)
@@ -482,7 +486,10 @@ class IMAP(object):
if _subscribe:
log.debug(_("Subscribing %s to folder %s") % (folder, _folder), level=8)
- self.subscribe(_folder)
+ try:
+ self.subscribe(_folder)
+ except Exception, errmsg:
+ log.error(_("Subscribing %s to folder %s failed: %r") % (folder, _folder, errmsg))
self.logout()
self.connect(domain=self.domain)
@@ -540,7 +547,9 @@ class IMAP(object):
log.warning(_("Moving INBOX folder %s won't succeed as target folder %s already exists") % (old_name,new_name))
def user_mailbox_server(self, mailbox):
- return self.imap.find_mailfolder_server(mailbox)
+ server = self.imap.find_mailfolder_server(mailbox.lower()).lower()
+ log.debug(_("Server for mailbox %r is %r") % (mailbox, server), level=8)
+ return server
def has_folder(self, folder):
"""