summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-07 13:12:42 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-09-07 13:14:54 +0100
commitc52d414f8756a405fd98df58f7ca2abc040a5fe1 (patch)
treed7cacec457ae2076d3bb0ad665059d559436186c /pykolab
parentb241933e98c81fde65b2af9d0e873e00dea7b75d (diff)
downloadpykolab-c52d414f8756a405fd98df58f7ca2abc040a5fe1.tar.gz
Make sure quota changes propagate from LDAP to IMAP
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/__init__.py5
-rw-r--r--pykolab/imap/__init__.py11
2 files changed, 14 insertions, 2 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 18ac294..67657f5 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -858,7 +858,6 @@ class LDAP(pykolab.base.Base):
)
def user_quota(self, entry_id, folder):
-
default_quota = self.config_get('default_quota')
quota_attribute = self.config_get('quota_attribute')
@@ -874,6 +873,7 @@ class LDAP(pykolab.base.Base):
current_ldap_quota = self.get_entry_attribute(entry_dn, quota_attribute)
_imap_quota = self.imap.get_quota(folder)
+
if _imap_quota == None:
used = None
current_imap_quota = None
@@ -1078,6 +1078,7 @@ class LDAP(pykolab.base.Base):
entry[result_attribute],
entry[mailserver_attribute]
)
+
else:
folder = "user%s%s" % (self.imap.separator,entry[result_attribute])
@@ -1258,6 +1259,8 @@ class LDAP(pykolab.base.Base):
conf.changelog[entry['id']] = entry_changes[result_attribute]
+ self.user_quota(entry, "user%s%s" % (self.imap.separator,entry[result_attribute]))
+
def _change_none_group(self, entry, change):
"""
A group entry as part of the initial search result set.
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index c6e3889..391714d 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -416,9 +416,11 @@ class IMAP(object):
)
if len(folder.split('@')) > 1:
+ localpart = folder.split('@')[0]
domain = folder.split('@')[1]
domain_suffix = "@%s" % (domain)
else:
+ localpart = folder
domain = None
domain_suffix = ""
@@ -465,7 +467,14 @@ class IMAP(object):
self.connect(domain=self.domain)
for additional_folder in additional_folders.keys():
- folder_name = additional_folder
+ folder_name = "user%s%s%s%s%s" % (
+ self.imap.separator,
+ localpart,
+ self.imap.separator,
+ additional_folder,
+ domain_suffix
+ )
+
if additional_folders[additional_folder].has_key("quota"):
self.imap.sq(
folder_name,