summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-29 13:08:59 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-29 13:08:59 +0000
commit5468b34206827efca734ec453d217c033f50ee2f (patch)
treefb2ddaef77be7de5ff0f2fec1ff2c648563230cc
parentcd4dafe15d907ceac435509bd7eab71cfd162264 (diff)
downloadpykolab-5468b34206827efca734ec453d217c033f50ee2f.tar.gz
Correct indentation and correct smtp sasl configuration
-rw-r--r--pykolab/setup/setup_freebusy.py2
-rw-r--r--pykolab/setup/setup_ldap.py32
-rw-r--r--pykolab/setup/setup_mta.py20
-rw-r--r--pykolab/setup/setup_roundcube.py6
-rw-r--r--pykolab/setup/setup_zpush.py2
5 files changed, 34 insertions, 28 deletions
diff --git a/pykolab/setup/setup_freebusy.py b/pykolab/setup/setup_freebusy.py
index 7fe7d5f..9d99ca9 100644
--- a/pykolab/setup/setup_freebusy.py
+++ b/pykolab/setup/setup_freebusy.py
@@ -114,7 +114,7 @@ def execute(*args, **kw):
elif os.path.isfile('/sbin/service'):
subprocess.call(['/sbin/service', 'httpd', 'restart'])
elif os.path.isfile('/usr/sbin/service'):
- subprocess.call(['/usr/sbin/service','apache2','restart'])
+ subprocess.call(['/usr/sbin/service','apache2','restart'])
else:
log.error(_("Could not start the webserver server service."))
diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index 430bfae..7c8cf2a 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -111,26 +111,26 @@ def execute(*args, **kw):
""")
)
- try:
- pw = pwd.getpwnam("dirsrv")
- except:
- _input['userid'] = utils.ask_question(_("User"), default="nobody")
- _input['group'] = utils.ask_question(_("Group"), default="nobody")
- else:
- _input['userid'] = utils.ask_question(_("User"), default="dirsrv")
- _input['group'] = utils.ask_question(_("Group"), default="dirsrv")
+ try:
+ pw = pwd.getpwnam("dirsrv")
+ except:
+ _input['userid'] = utils.ask_question(_("User"), default="nobody")
+ _input['group'] = utils.ask_question(_("Group"), default="nobody")
+ else:
+ _input['userid'] = utils.ask_question(_("User"), default="dirsrv")
+ _input['group'] = utils.ask_question(_("Group"), default="dirsrv")
else:
_input['admin_pass'] = conf.get('ldap', 'bind_pw')
_input['dirmgr_pass'] = conf.get('ldap', 'bind_pw')
try:
- pw = pwd.getpwnam("dirsrv")
- except:
- _input['userid'] = "nobody"
- _input['group'] = "nobody"
- else:
- _input['userid'] = "dirsrv"
- _input['group'] = "dirsrv"
+ pw = pwd.getpwnam("dirsrv")
+ except:
+ _input['userid'] = "nobody"
+ _input['group'] = "nobody"
+ else:
+ _input['userid'] = "dirsrv"
+ _input['group'] = "dirsrv"
# TODO: Verify the user and group exist.
@@ -245,7 +245,7 @@ ServerAdminPwd = %(admin_pass)s
else:
log.error(_("No directory server setup tool available."))
sys.exit(1)
-
+
command = [
setup_ds_admin,
'--debug',
diff --git a/pykolab/setup/setup_mta.py b/pykolab/setup/setup_mta.py
index eb26a4d..8dd338d 100644
--- a/pykolab/setup/setup_mta.py
+++ b/pykolab/setup/setup_mta.py
@@ -218,7 +218,7 @@ result_attribute = mail
'/usr/share/postfix/main.cf.debian',
'/etc/postfix/main.cf'
)
-
+
myaugeas = Augeas()
setting_base = '/files/etc/postfix/main.cf/'
@@ -268,6 +268,12 @@ result_attribute = mail
log.error(_("Could not write out Postfix configuration file /etc/postfix/master.cf"))
return
+ if os.path.isdir('/etc/postfix/sasl/'):
+ fp = open('/etc/postfix/sasl/smtpd.conf', 'w')
+ fp.write("pwcheck_method: saslauthd\n")
+ fp.write("mech_list: plain login\n")
+ fp.close()
+
amavisd_settings = {
'ldap_server': 'localhost',
'ldap_bind_dn': conf.get('ldap', 'service_bind_dn'),
@@ -298,7 +304,7 @@ result_attribute = mail
if os.path.isdir('/etc/amavisd'):
fp = open('/etc/amavisd/amavisd.conf', 'w')
elif os.path.isdir('/etc/amavis'):
- fp = open('/etc/amavis/amavisd.conf', 'w')
+ fp = open('/etc/amavis/amavisd.conf', 'w')
fp.write(t.__str__())
fp.close()
@@ -307,15 +313,15 @@ result_attribute = mail
return
# On APT installations, /etc/amavis/conf.d/ is a directory with many more files.
- #
+ #
# Somebody could work on enhancement request #1080 to configure LDAP lookups,
# while really it isn't required.
else:
log.info(_("Not writing out any configuration for Amavis."))
- # On debian wheezy amavisd-new expects '/etc/mailname' - possibly remediable through
- # the #1080 enhancement mentioned above, but here's a quick fix.
- f = open('/etc/mailname','w')
+ # On debian wheezy amavisd-new expects '/etc/mailname' - possibly remediable through
+ # the #1080 enhancement mentioned above, but here's a quick fix.
+ f = open('/etc/mailname','w')
f.writelines(conf.get('kolab', 'primary_domain'))
f.close()
@@ -326,7 +332,7 @@ result_attribute = mail
myaugeas.set(setting,'1')
myaugeas.save()
myaugeas.close()
-
+
if os.path.isfile('/bin/systemctl'):
subprocess.call(['systemctl', 'restart', 'postfix.service'])
subprocess.call(['systemctl', 'restart', 'amavisd.service'])
diff --git a/pykolab/setup/setup_roundcube.py b/pykolab/setup/setup_roundcube.py
index f3ab1b9..5eed26c 100644
--- a/pykolab/setup/setup_roundcube.py
+++ b/pykolab/setup/setup_roundcube.py
@@ -124,9 +124,9 @@ def execute(*args, **kw):
)
fp = None
- if os.path.isdir('/etc/roundcubemail'):
- fp = open('/etc/roundcubemail/%s' % (want_file), 'w')
- elif os.path.isdir('/etc/roundcube'):
+ if os.path.isdir('/etc/roundcubemail'):
+ fp = open('/etc/roundcubemail/%s' % (want_file), 'w')
+ elif os.path.isdir('/etc/roundcube'):
fp = open('/etc/roundcube/%s' % (want_file), 'w')
if not fp == None:
diff --git a/pykolab/setup/setup_zpush.py b/pykolab/setup/setup_zpush.py
index 4c84d3a..809d243 100644
--- a/pykolab/setup/setup_zpush.py
+++ b/pykolab/setup/setup_zpush.py
@@ -106,4 +106,4 @@ def execute(*args, **kw):
else:
log.error(_("Could not configure to start on boot, the " + \
"webserver server service."))
-
+