Skip to content

Commit

Permalink
cook-189, use 0.7.10+ notation for setting attributes (default)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Sep 28, 2009
1 parent 6ac033b commit 6248ab7
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions attributes/postfix.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6248ab7

Please sign in to comment.