summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
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:32:25 +0100
commit0b3c16cae2c6adef3f928cb7e29cfdc11a18f877 (patch)
tree8233a78636cb77cfcfdcb7bdaf830f605ae9255f /pykolab/imap
parent1895521a9de5b7e852d8b0ac3b5181c0be913b6b (diff)
downloadpykolab-0b3c16cae2c6adef3f928cb7e29cfdc11a18f877.tar.gz
Move setting the quota to outside of the loop where we login as the user
Diffstat (limited to 'pykolab/imap')
-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)