#64 - add smtp_generic maps configuration option

Signed-off-by: Sean OMeara <someara@opscode.com>
This commit is contained in:
skubriev
2014-06-11 13:50:20 -04:00
committed by Sean OMeara
parent 3dd026f899
commit e2d49e10e9
4 changed files with 43 additions and 1 deletions

View File

@@ -89,7 +89,26 @@ unless node['postfix']['sender_canonical_map_entries'].empty?
end
end
%w(main master).each do |cfg|
execute 'update-postfix-smtp_generic' do
command "postmap #{node['postfix']['conf_dir']}/smtp_generic"
action :nothing
end
if !node['postfix']['smtp_generic_map_entries'].empty?
template "#{node['postfix']['conf_dir']}/smtp_generic" do
owner 'root'
group 0
mode '0644'
notifies :run, 'execute[update-postfix-smtp_generic]'
notifies :reload, 'service[postfix]'
end
if !node['postfix']['main'].key?('smtp_generic_maps')
node.set['postfix']['main']['smtp_generic_maps'] = "hash:#{node['postfix']['conf_dir']}/smtp_generic"
end
end
%w{main master}.each do |cfg|
template "#{node['postfix']['conf_dir']}/#{cfg}.cf" do
source "#{cfg}.cf.erb"
owner 'root'