summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
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-14 13:18:12 +0100
commit9ce5363757ccf92b3ad3212b230c8d1699e703d6 (patch)
tree536f167ec9c6eeea4dba3f84ed5d536b954f219f /pykolab/imap
parent7748c269ca10c1ca966af6c46fb9a8ed863c03f8 (diff)
downloadpykolab-9ce5363757ccf92b3ad3212b230c8d1699e703d6.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.
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index b154476..fbaaf28 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -559,6 +559,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)
@@ -571,18 +575,12 @@ class IMAP(object):
if _folder.startswith(_test):
_subscribe = False
- # If the namespace prefix for "shared" is "", we need to
- # catch this.
- for __test in _tests:
- if _subscribe:
- continue
-
- if _folder.startswith(__test):
- _subscribe = True
-
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)
@@ -647,7 +645,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.lower())
+ 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):
"""