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-02 15:27:50 +0100
commit73166b376fcc278988401694c53e189989a61727 (patch)
treea9d10fd14851bf8630226fdde263544209434f1c
parent297191d91ce94e3a4b5c32ed122147f02711dcfd (diff)
downloadpykolab-73166b376fcc278988401694c53e189989a61727.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"):