Permalink
Browse files

postfix: Allow disabling smtpd TLS via an attribute

  • Loading branch information...
1 parent c2997a9 commit ea9666677d7ed34584201e06e9ef4f2e5f46cb49 Alex Tomlins committed with jtimberman May 11, 2011
Showing with 5 additions and 1 deletion.
  1. +2 −0 postfix/attributes/default.rb
  2. +3 −1 postfix/templates/default/main.cf.erb
View
2 postfix/attributes/default.rb
@@ -5,6 +5,8 @@
default[:postfix][:relayhost] = ""
default[:postfix][:mail_relay_networks] = "127.0.0.0/8"
+default[:postfix][:smtpd_use_tls] = "yes"
+
default[:postfix][:smtp_sasl_auth_enable] = "no"
default[:postfix][:smtp_sasl_password_maps] = "hash:/etc/postfix/sasl_passwd"
default[:postfix][:smtp_sasl_security_options] = "noanonymous"
View
4 postfix/templates/default/main.cf.erb
@@ -5,10 +5,12 @@
biff = no
append_dot_mydomain = no
+smtpd_use_tls = <%= node[:postfix][:smtpd_use_tls] %>
+<% if node[:postfix][:smtpd_use_tls] == "yes" -%>
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
-smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
+<% end -%>
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtp_sasl_auth_enable = <%= node[:postfix][:smtp_sasl_auth_enable] %>
<% if node[:postfix][:smtp_sasl_auth_enable] == "yes" -%>

0 comments on commit ea96666

Please sign in to comment.