diff --git a/attributes/postfix.rb b/attributes/postfix.rb index 784bf9e..d9ff0e3 100644 --- a/attributes/postfix.rb +++ b/attributes/postfix.rb @@ -1,19 +1,17 @@ -postfix Mash.new unless attribute?("postfix") +default[:postfix][:mail_type] = "client" +default[:postfix][:myhostname] = fqdn +default[:postfix][:mydomain] = domain +default[:postfix][:myorigin] = "$myhostname" +default[:postfix][:relayhost] = "" +default[:postfix][:mail_relay_networks] = "127.0.0.0/8" -postfix[:mail_type] = "client" unless postfix.has_key?(:mail_type) -postfix[:myhostname] = fqdn unless postfix.has_key?(:myhostname) -postfix[:mydomain] = domain unless postfix.has_key?(:mydomain) -postfix[:myorigin] = "$myhostname" unless postfix.has_key?(:myorigin) -postfix[:relayhost] = "" unless postfix.has_key?(:relayhost) -postfix[:mail_relay_networks] = "127.0.0.0/8" unless postfix.has_key?(:mail_relay_networks) - -postfix[:smtp_sasl_auth_enable] = "no" unless postfix.has_key?(:smtp_sasl_auth_enable) +default[:postfix][:smtp_sasl_auth_enable] = "no" if postfix[:smtp_sasl_auth_enable] == "yes" - postfix[:smtp_sasl_password_maps] = "hash:/etc/postfix/sasl_passwd" - postfix[:smtp_sasl_security_options] = "noanonymous" - postfix[:smtp_tls_cafile] = "/etc/postfix/cacert.pem" - postfix[:smtp_use_tls] = "yes" - postfix[:smtp_sasl_user_name] = "" unless postfix.has_key?(:smtp_sasl_user_name) - postfix[:smtp_sasl_passwd] = "" unless postfix.has_key?(:smtp_sasl_passwd) + default[:postfix][:smtp_sasl_password_maps] = "hash:/etc/postfix/sasl_passwd" + default[:postfix][:smtp_sasl_security_options] = "noanonymous" + default[:postfix][:smtp_tls_cafile] = "/etc/postfix/cacert.pem" + default[:postfix][:smtp_use_tls] = "yes" + default[:postfix][:smtp_sasl_user_name] = "" + default[:postfix][:smtp_sasl_passwd] = "" end