summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-03-01 10:43:42 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-03-01 10:43:42 +0100
commit93baeadf7ee5744522a89e836740ff9e708c96f5 (patch)
tree9f269d370ddfaeb267b97fa5573d736218524496
parentf2988f16265bb40b83415fead738eda71ad1ba1d (diff)
downloadpykolab-93baeadf7ee5744522a89e836740ff9e708c96f5.tar.gz
Fix calling the wrong function to list domains, and using the wrong primary
-rw-r--r--pykolab/imap/__init__.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index b00b916..afc65a8 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -536,15 +536,20 @@ class IMAP(object):
from pykolab.auth import Auth
auth = Auth()
auth.connect()
- domains = auth._list_domains(self.domain)
+
+ domains = auth.list_domains(self.domain)
+
auth.disconnect()
- if len(domains) > 0:
- (primary,secondaries) = domains[1]
- if conf.has_option(primary, "autocreate_folders"):
- _additional_folders = conf.get_raw(
- primary,
- "autocreate_folders"
- )
+
+ if len(domains.keys()) > 0:
+ if domains.has_key(self.domain):
+ primary = domains[self.domain]
+
+ if conf.has_option(primary, "autocreate_folders"):
+ _additional_folders = conf.get_raw(
+ primary,
+ "autocreate_folders"
+ )
if _additional_folders == None:
if conf.has_option('kolab', "autocreate_folders"):