[COOK-4410] - Fix sender_canonical configuration by adding template and postmap execution
Signed-off-by: Sean OMeara <someara@opscode.com>
This commit is contained in:
parent
39f1d1d474
commit
1c3f6981ee
@ -72,12 +72,18 @@ when 'omnios'
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
execute 'update-postfix-sender_canonical' do
|
||||||
|
command "postmap #{node['postfix']['conf_dir']}/sender_canonical"
|
||||||
|
action :nothing
|
||||||
|
end
|
||||||
|
|
||||||
if !node['postfix']['sender_canonical_map_entries'].empty?
|
if !node['postfix']['sender_canonical_map_entries'].empty?
|
||||||
template "#{node['postfix']['conf_dir']}/sender_canonical" do
|
template "#{node['postfix']['conf_dir']}/sender_canonical" do
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group 0
|
group 0
|
||||||
mode '0644'
|
mode '0644'
|
||||||
notifies :restart, 'service[postfix]'
|
notifies :run, 'execute[update-postfix-sender_canonical]'
|
||||||
|
notifies :reload, 'service[postfix]'
|
||||||
end
|
end
|
||||||
|
|
||||||
if !node['postfix']['main'].key?('sender_canonical_maps')
|
if !node['postfix']['main'].key?('sender_canonical_maps')
|
||||||
|
10
templates/default/sender_canonical.erb
Normal file
10
templates/default/sender_canonical.erb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# This file is generated by Chef for <%= node['fqdn'] %>
|
||||||
|
#
|
||||||
|
# Local changes will be overwritten
|
||||||
|
#
|
||||||
|
# See man 5 canonical for format
|
||||||
|
|
||||||
|
<% node['postfix']['sender_canonical_map_entries'].each do |name, value| %>
|
||||||
|
<%= name %> <%= value %>
|
||||||
|
<% end unless node['postfix']['sender_canonical_map_entries'].nil? %>
|
Loading…
x
Reference in New Issue
Block a user