summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hoffend <dh@dotlan.net>2015-01-25 14:42:01 +0100
committerDaniel Hoffend <dh@dotlan.net>2015-01-26 00:36:08 +0100
commit6b9fe599d2f2811b2532a8eef43fa74e440775f6 (patch)
tree74f870f673f7cafc9add913539a81904edc627cd
parenta0507f5e48a48a0e2df42093c368a630791ff65e (diff)
downloadpykolab-6b9fe599d2f2811b2532a8eef43fa74e440775f6.tar.gz
fix imap_uri processing for setup_freebusy
-rw-r--r--pykolab/setup/setup_freebusy.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/pykolab/setup/setup_freebusy.py b/pykolab/setup/setup_freebusy.py
index dacd2d3..80d5889 100644
--- a/pykolab/setup/setup_freebusy.py
+++ b/pykolab/setup/setup_freebusy.py
@@ -68,18 +68,24 @@ def execute(*args, **kw):
if hasattr(result, 'hostname'):
hostname = result.hostname
+
+ if hasattr(result, 'port'):
+ port = result.port
+
+ if hasattr(result, 'scheme'):
+ scheme = result.scheme
+
else:
scheme = imap_uri.split(':')[0]
(hostname, port) = imap_uri.split('/')[2].split(':')
- if port == None:
+ if scheme == 'imaps' and (port == None or port == ''):
port = 993
- if scheme == None or scheme == "":
- scheme = 'imaps'
+ if scheme == None or scheme == '':
+ scheme = 'imap'
- if scheme == "imaps" and port == 993:
- scheme = "imap"
+ if port == None or port == '':
port = 143
resources_imap_uri = '%s://%s:%s@%s:%s/%%kolabtargetfolder?acl=lrs' % (scheme, admin_login, admin_password, hostname, port)