Permalink
Browse files

configurable inet_interfaces

  • Loading branch information...
1 parent 682fe0c commit e2ecce710b1746b201711da8abb3adc8c7c500bc @clkao clkao committed Sep 16, 2012
Showing with 7 additions and 2 deletions.
  1. +5 −0 metadata.rb
  2. +2 −2 templates/default/main.cf.erb
View
@@ -68,6 +68,11 @@
:description => "Sets the value of smtp_sasl_security_options in main.cf",
:default => "noanonymous"
+attribute "postfix/inet_interfaces",
+ :display_name => "Postfix listening interfaces",
+ :description => "Interfaces to listen to, all or loopback-only. default is all for master mail_type, and loopback-only otherwise",
+ :default => ""
+
attribute "postfix/smtp_tls_cafile",
:display_name => "Postfix SMTP TLS CA File",
:description => "CA certificate file for SMTP over TLS",
@@ -31,11 +31,11 @@ mydestination = <%= node['postfix']['myhostname'] %>, <%= node['hostname'] %>, l
<% if node['postfix']['mail_type'] == "master" -%>
relayhost =
mynetworks = <%= node['postfix']['mail_relay_networks'] %>
-inet_interfaces = all
+inet_interfaces = <%= node[:postfix][:inet_interfaces] || 'all' %>
@patcon

patcon Jan 3, 2013

No biggie, but I think the normal Chef pattern is to set the default to all in the attributes file as opposed to hardcoding it into the template :)

<% else -%>
relayhost = <%= node['postfix']['relayhost'] %>
mynetworks = <%= node['postfix']['mail_relay_networks'] %>
-inet_interfaces = loopback-only
+inet_interfaces = <%= node[:postfix][:inet_interfaces] || 'loopback-only' %>
<% end -%>
<% if node['postfix']['use_procmail'] -%>
mailbox_command = /usr/bin/procmail -a "$EXTENSION"

0 comments on commit e2ecce7

Please sign in to comment.