summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-05 19:50:38 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-05 20:25:16 +0100
commita8d64317834c4efc56d41b314d0a219e5de7ecfd (patch)
tree27317fcc06bf4b60137297715478ddb31819c3f3 /pykolab/imap
parent4e63299089254bbe6be5fa6e58458475276825cb (diff)
downloadpykolab-a8d64317834c4efc56d41b314d0a219e5de7ecfd.tar.gz
Make sure the pattern for deleting mailboxes is passed on right between various function calls
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 63245d6..8b7b899 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -249,6 +249,10 @@ class IMAP(object):
from pykolab import imap_utf7
return imap_utf7.encode(folder)
+ def folder_utf8(self, folder):
+ from pykolab import imap_utf7
+ return imap_utf7.decode(folder)
+
def get_metadata(self, folder):
"""
Obtain all metadata entries on a folder
@@ -898,16 +902,16 @@ class IMAP(object):
log.info(_("Deleting folder %s") % (mailfolder_path))
- self.imap.dm(mailfolder_path)
+ self.imap.dm(self.folder_utf7(mailfolder_path))
def get_quota(self, mailfolder_path):
try:
- return self.lq(mailfolder_path)
+ return self.lq(self.folder_utf7(mailfolder_path))
except:
return
def get_quota_root(self, mailfolder_path):
- return self.lqr(mailfolder_path)
+ return self.lqr(self.folder_utf7(mailfolder_path))
def list_acls(self, folder):
"""
@@ -915,6 +919,9 @@ class IMAP(object):
"""
return self.imap.lam(folder)
+ def list_folders(self, pattern):
+ return self.lm(self.folder_utf7(pattern))
+
def list_user_folders(self, primary_domain=None, secondary_domains=[]):
"""
List the INBOX folders in the IMAP backend. Returns a list of unique