diff --git a/metadata.rb b/metadata.rb index aabab74..1c2d813 100644 --- a/metadata.rb +++ b/metadata.rb @@ -68,6 +68,11 @@ attribute "postfix/smtp_sasl_security_options", :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", diff --git a/templates/default/main.cf.erb b/templates/default/main.cf.erb index cae3e7a..d1f89f5 100644 --- a/templates/default/main.cf.erb +++ b/templates/default/main.cf.erb @@ -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' %> <% 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"