summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"):