summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-11-21 14:58:07 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-11-21 14:58:07 +0100
commitd54170b4b5ecbdcd7238d7cfadfd261f5db93366 (patch)
tree22563a3ba0c36469be6de41edb83168e7ff7de5b /pykolab/imap
parenta8d3a2e13ff4cfda96e09356bc249c5932f71f41 (diff)
downloadpykolab-d54170b4b5ecbdcd7238d7cfadfd261f5db93366.tar.gz
Take the autocreate_folders setting from the [kolab] section if it exists there, and no domain specific autocreate_folders exists (#2492)
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py41
1 files changed, 25 insertions, 16 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 52dfdc1..b154476 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -427,24 +427,33 @@ class IMAP(object):
if not self.domain == None:
if conf.has_option(self.domain, "autocreate_folders"):
- _additional_folders = conf.get_raw(
- self.domain,
- "autocreate_folders"
- )
+ _additional_folders = conf.get_raw(
+ self.domain,
+ "autocreate_folders"
+ )
- additional_folders = conf.plugins.exec_hook(
- "create_user_folders",
- kw={
- 'folder': folder_name,
- 'additional_folders': _additional_folders
- }
- )
+ elif conf.has_option('kolab', "autocreate_folders"):
+ _additional_folders = conf.get_raw(
+ 'kolab',
+ "autocreate_folders"
+ )
+ else:
+ _additional_folders = {}
+
+ additional_folders = conf.plugins.exec_hook(
+ "create_user_folders",
+ kw={
+ 'folder': folder_name,
+ 'additional_folders': _additional_folders
+ }
+ )
+
+ if not additional_folders == None:
+ self.user_mailbox_create_additional_folders(
+ mailbox_base_name,
+ additional_folders
+ )
- if not additional_folders == None:
- self.user_mailbox_create_additional_folders(
- mailbox_base_name,
- additional_folders
- )
if conf.has_option(self.domain, "sieve_mgmt"):
sieve_mgmt_enabled = conf.get(self.domain, 'sieve_mgmt')
if utils.true_or_false(sieve_mgmt_enabled):