summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/imap/__init__.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 3fc72d3..b5aff55 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -43,14 +43,13 @@ class IMAP(object):
self.imap = None
def cleanup_acls(self, aci_subject):
- lm_suffix = ""
-
log.info(
_("Cleaning up ACL entries for %s across all folders") % (
aci_subject
)
)
+ lm_suffix = ""
if len(aci_subject.split('@')) > 1:
lm_suffix = "@%s" % (aci_subject.split('@')[1])
@@ -58,13 +57,6 @@ class IMAP(object):
user_folders = self.imap.lm("user/*%s" % (lm_suffix))
- log.debug(
- _("Cleaning up ACL entries referring to identifier %s") % (
- aci_subject
- ),
- level=5
- )
-
# For all folders (shared and user), ...
folders = user_folders + shared_folders
@@ -72,8 +64,8 @@ class IMAP(object):
# ... loop through them and ...
for folder in folders:
- # ... list the ACL entries -- but only if the folder still exists
- if self.imap.has_folder(folder):
+ try:
+ # ... list the ACL entries
acls = self.imap.lam(folder)
# For each ACL entry, see if we think it is a current, valid
@@ -96,13 +88,13 @@ class IMAP(object):
)
self.set_acl(folder, acl_entry, '')
- else:
- log.debug(
- _("Folder %r disappeared (ACL cleanup for %r") % (
+
+ except Exception, errmsg:
+ log.error(
+ _("Failed to read/set ACL on folder %s: %r") % (
folder,
- aci_subject
- ),
- level=8
+ errmsg
+ )
)
def connect(self, uri=None, server=None, domain=None, login=True):