summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2019-10-08 13:16:22 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2019-10-08 13:16:22 +0200
commit90b53863e43c568f9ed1fcfa932f8ace558ebe34 (patch)
tree2f0b5566a963fb5029b054c054f811f71bc9d365
parent894df668e96af15b172eff9b0e4ffcb42aa76084 (diff)
downloadpykolab-90b53863e43c568f9ed1fcfa932f8ace558ebe34.tar.gz
Fix configuration compability with stock Debian cyrus imapd
-rw-r--r--pykolab/setup/setup_imap.py14
-rw-r--r--share/templates/imapd.conf.tpl6
2 files changed, 17 insertions, 3 deletions
diff --git a/pykolab/setup/setup_imap.py b/pykolab/setup/setup_imap.py
index 584787c..5b6747d 100644
--- a/pykolab/setup/setup_imap.py
+++ b/pykolab/setup/setup_imap.py
@@ -49,6 +49,17 @@ def execute(*args, **kw):
Apply the necessary settings to /etc/imapd.conf
"""
+ configdirectory = "/var/lib/imap/"
+ partition_default = "/var/spool/imap/"
+ sievedir = "/var/lib/imap/sieve/"
+
+ if os.path.isdir("/var/lib/cyrus/"):
+ configdirectory = "/var/lib/cyrus/"
+ sievedir = "/var/lib/cyrus/sieve/"
+
+ if os.path.isdir("/var/spool/cyrus/"):
+ partition_default = "/var/spool/cyrus/"
+
imapd_settings = {
"ldap_servers": conf.get('ldap', 'ldap_uri'),
"ldap_base": conf.get('ldap', 'base_dn'),
@@ -64,6 +75,9 @@ def execute(*args, **kw):
"ldap_member_attribute": "nsrole",
"admins": conf.get('cyrus-imap', 'admin_login'),
"postuser": "shared",
+ "configdirectory": configdirectory,
+ "partition_default": partition_default,
+ "sievedir": sievedir
}
template_file = None
diff --git a/share/templates/imapd.conf.tpl b/share/templates/imapd.conf.tpl
index 6437949..72269fb 100644
--- a/share/templates/imapd.conf.tpl
+++ b/share/templates/imapd.conf.tpl
@@ -1,7 +1,7 @@
-configdirectory: /var/lib/imap
-partition-default: /var/spool/imap
+configdirectory: $configdirectory
+partition-default: $partition_default
admins: $admins
-sievedir: /var/lib/imap/sieve
+sievedir: $sievedir
sendmail: /usr/sbin/sendmail
sasl_pwcheck_method: saslauthd
sasl_mech_list: PLAIN LOGIN