summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-08-13 11:53:47 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-08-13 11:53:47 +0100
commit33bb7fa7b46e553e0aeb5878163cf81490881683 (patch)
treecb7ce87bd9e857ad1e0a146c617e882df32f51f1 /pykolab
parent152bd708a2b3e4816faef0ebec7a5dbf7f3b8120 (diff)
downloadpykolab-33bb7fa7b46e553e0aeb5878163cf81490881683.tar.gz
Add stripping certain headers using header_checks as a default
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_mta.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pykolab/setup/setup_mta.py b/pykolab/setup/setup_mta.py
index 9004e6b..ed30f50 100644
--- a/pykolab/setup/setup_mta.py
+++ b/pykolab/setup/setup_mta.py
@@ -237,6 +237,8 @@ result_format = shared+%%s
"transport_maps": "ldap:/etc/postfix/ldap/transport_maps.cf, hash:/etc/postfix/transport",
"virtual_alias_maps": "$alias_maps, ldap:/etc/postfix/ldap/virtual_alias_maps.cf, ldap:/etc/postfix/ldap/virtual_alias_maps_sharedfolders.cf, ldap:/etc/postfix/ldap/mailenabled_distgroups.cf, ldap:/etc/postfix/ldap/mailenabled_dynamic_distgroups.cf",
"smtpd_tls_auth_only": "yes",
+ "smtpd_tls_security_level": "may",
+ "smtp_tls_security_level": "may",
"smtpd_sasl_auth_enable": "yes",
"smtpd_sender_login_maps": "$relay_recipient_maps",
"smtpd_sender_restrictions": "permit_mynetworks, reject_sender_login_mismatch",
@@ -263,6 +265,19 @@ result_format = shared+%%s
'/etc/postfix/main.cf'
)
+ # Copy header checks files
+ for hc_file in [ 'inbound', 'internal', 'submission' ]:
+ if not os.path.isfile("/etc/postfix/header_checks.%s" % (hc_file)):
+ if os.path.isfile('/etc/kolab/templates/header_checks.%s' % (hc_file)):
+ input_file = '/etc/kolab/templates/header_checks.%s' % (hc_file)
+ elif os.path.isfile('/usr/share/kolab/templates/header_checks.%s' % (hc_file)):
+ input_file = '/usr/share/kolab/templates/header_checks.%s' % (hc_file)
+ elif os.path.isfile(os.path.abspath(os.path.join(__file__, '..', '..', '..', 'share', 'templates', 'header_checks.%s' % (hc_file)))):
+ input_file = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'share', 'templates', 'header_checks.%s' % (hc_file)))
+
+ shutil.copy(input_file, "/etc/postfix/header_checks.%s" % (hc_file))
+ subprocess.call(["postmap", "/etc/postfix/header_checks.%s" % (hc_file)])
+
myaugeas = Augeas()
setting_base = '/files/etc/postfix/main.cf/'