From e6b58b270b5257badd59ca050a82123640768ae8 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 11 Jun 2014 14:04:34 -0400 Subject: [PATCH] #68 -Properly handle binding to loopback on mixed IPV4/IPV6 systems Signed-off-by: Sean OMeara --- README.md | 6 +++--- attributes/default.rb | 6 +++--- files/default/tests/minitest/support/helpers.rb | 2 +- metadata.rb | 4 ++-- recipes/aliases.rb | 2 +- recipes/client.rb | 4 ++-- recipes/default.rb | 8 ++++---- recipes/sasl_auth.rb | 4 ++-- recipes/server.rb | 4 ++-- templates/default/main.cf.erb | 1 + 10 files changed, 21 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 51a277c..a92f6eb 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ This change in namespace to `node['postfix']['main']` should allow for greater f * `node['postfix']['main']['myhostname']` - defaults to fqdn from Ohai * `node['postfix']['main']['mydomain']` - defaults to domain from Ohai * `node['postfix']['main']['myorigin']` - defaults to $myhostname -* `node['postfix']['main']['mynetworks']` - default is `127.0.0.0/8` +* `node['postfix']['main']['mynetworks']` - default is nil, which forces Postfix to default to loopback addresses. * `node['postfix']['main']['inet_interfaces']` - set to `loopback-only`, or `all` for server recipe * `node['postfix']['main']['alias_maps']` - set to `hash:/etc/aliases` * `node['postfix']['main']['mailbox_size_limit']` - set to `0` (disabled) @@ -250,10 +250,10 @@ override_attributes( License & Authors ----------------- -- Author:: Joshua Timberman +- Author:: Joshua Timberman ```text -Copyright:: 2009-2012, Opscode, Inc +Copyright:: 2009-2014, Chef Software, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/attributes/default.rb b/attributes/default.rb index 3755c36..e2a25c3 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,6 +1,6 @@ # encoding: utf-8 -# Author:: Joshua Timberman -# Copyright:: Copyright (c) 2009, Opscode, Inc. +# Author:: Joshua Timberman +# Copyright:: Copyright 2009-2014, Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -64,7 +64,7 @@ default['postfix']['main']['transport_maps'] = [ "hash:#{node['postfix']['transp default['postfix']['main']['access_maps'] = ["hash:#{node['postfix']['access_db']}"] default['postfix']['main']['mailbox_size_limit'] = 0 default['postfix']['main']['smtp_sasl_auth_enable'] = 'no' -default['postfix']['main']['mynetworks'] = '127.0.0.0/8' +default['postfix']['main']['mynetworks'] = nil default['postfix']['main']['inet_interfaces'] = 'loopback-only' # Conditional attributes diff --git a/files/default/tests/minitest/support/helpers.rb b/files/default/tests/minitest/support/helpers.rb index 2fa4407..f306f2e 100644 --- a/files/default/tests/minitest/support/helpers.rb +++ b/files/default/tests/minitest/support/helpers.rb @@ -1,5 +1,5 @@ # encoding: utf-8 -# Copyright 2012, Opscode, Inc. +# Copyright 2012-2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/metadata.rb b/metadata.rb index 70d7a7b..18268d7 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,8 +1,8 @@ # encoding: utf-8 name 'postfix' description 'Installs and configures postfix for client or outbound relayhost, or to do SASL auth' -maintainer 'Opscode, Inc.' -maintainer_email 'cookbooks@opscode.com' +maintainer 'Chef Software, Inc.' +maintainer_email 'cookbooks@getchef.com' license 'Apache 2.0' version '3.2.1' recipe 'postfix', 'Installs and configures postfix' diff --git a/recipes/aliases.rb b/recipes/aliases.rb index 76947a5..3ba0527 100644 --- a/recipes/aliases.rb +++ b/recipes/aliases.rb @@ -1,5 +1,5 @@ # encoding: utf-8 -# Copyright:: Copyright (c) 2012, Opscode, Inc. +# Copyright:: Copyright 2012-2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/client.rb b/recipes/client.rb index c13751d..c6817ff 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -1,9 +1,9 @@ # encoding: utf-8 -# Author:: Joshua Timberman() +# Author:: Joshua Timberman() # Cookbook Name:: postfix # Recipe:: client # -# Copyright 2009-2012, Opscode, Inc. +# Copyright 2009-2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/default.rb b/recipes/default.rb index b6e058d..227f9cd 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,9 +1,9 @@ # encoding: utf-8 -# Author:: Joshua Timberman() +# Author:: Joshua Timberman() # Cookbook Name:: postfix # Recipe:: default # -# Copyright 2009-2012, Opscode, Inc. +# Copyright 2009-2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -59,7 +59,7 @@ when 'omnios' source 'manifest-postfix.xml.erb' owner 'root' group 'root' - mode 00644 + mode '0644' notifies :run, 'execute[load postfix manifest]', :immediately end @@ -113,7 +113,7 @@ end source "#{cfg}.cf.erb" owner 'root' group 0 - mode 00644 + mode '0644' notifies :restart, 'service[postfix]' variables(settings: node['postfix'][cfg]) cookbook node['postfix']["#{cfg}_template_source"] diff --git a/recipes/sasl_auth.rb b/recipes/sasl_auth.rb index a019630..297a298 100644 --- a/recipes/sasl_auth.rb +++ b/recipes/sasl_auth.rb @@ -1,10 +1,10 @@ # encoding: utf-8 # -# Author:: Joshua Timberman() +# Author:: Joshua Timberman() # Cookbook Name:: postfix # Recipe:: sasl_auth # -# Copyright 2009, Opscode, Inc. +# Copyright 2009-2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/server.rb b/recipes/server.rb index 63dc71d..3f26a52 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -1,10 +1,10 @@ # encoding: utf-8 # -# Author:: Joshua Timberman() +# Author:: Joshua Timberman() # Cookbook Name:: postfix # Recipe:: server # -# Copyright 2009-2012, Opscode, Inc. +# Copyright 2009-2014, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/templates/default/main.cf.erb b/templates/default/main.cf.erb index 8592c7d..d4b7ae4 100644 --- a/templates/default/main.cf.erb +++ b/templates/default/main.cf.erb @@ -4,6 +4,7 @@ ### <% @settings.sort.map do |key, value| -%> +<% next if value.nil? -%> <% if value.kind_of? Array -%> <%= "#{key} = #{value.join(', ')}"%> <% else -%>