summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-06 12:32:25 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-06 12:33:46 +0100
commit77186dd4f9284e8bb89aaf900132f3dd70491173 (patch)
treec3615d4408fff3fccb618924c788c076a701b5f2 /pykolab
parent2f87524023d9cc907b5015cc7fbe3b217f4f432b (diff)
downloadpykolab-77186dd4f9284e8bb89aaf900132f3dd70491173.tar.gz
Move setting the quota to outside of the loop where we login as the user
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/imap/__init__.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index cabd059..c6e3889 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -407,12 +407,6 @@ class IMAP(object):
"%s" % (additional_folders[additional_folder]["annotations"][annotation])
)
- if additional_folders[additional_folder].has_key("quota"):
- self.imap.sq(
- folder_name,
- additional_folders[additional_folder]['quota']
- )
-
if additional_folders[additional_folder].has_key("acls"):
for acl in additional_folders[additional_folder]["acls"].keys():
self.imap.sam(
@@ -470,6 +464,14 @@ class IMAP(object):
self.logout()
self.connect(domain=self.domain)
+ for additional_folder in additional_folders.keys():
+ folder_name = additional_folder
+ if additional_folders[additional_folder].has_key("quota"):
+ self.imap.sq(
+ folder_name,
+ additional_folders[additional_folder]['quota']
+ )
+
def user_mailbox_delete(self, mailbox_base_name):
"""
Delete a user mailbox.
@@ -834,7 +836,10 @@ class IMAP(object):
return self.imap.lq(*args, **kw)
def lqr(self, *args, **kw):
- return self.imap.lqr(*args, **kw)
+ try:
+ return self.imap.lqr(*args, **kw)
+ except:
+ return (None, None, None)
def undelete_mailfolder(self, *args, **kw):
self.imap.undelete_mailfolder(*args, **kw)