X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/faf8ae12e85eabb050b0f5eceb2cb67ad1de5261..46487ed03159cfacfc370bef7d0dcc245d9ba079:/cookbooks/exim/recipes/default.rb diff --git a/cookbooks/exim/recipes/default.rb b/cookbooks/exim/recipes/default.rb index ff38860a0..b5b15080c 100644 --- a/cookbooks/exim/recipes/default.rb +++ b/cookbooks/exim/recipes/default.rb @@ -63,6 +63,23 @@ template "/etc/exim4/exim4.conf" do notifies :restart, resources(:service => "exim4") end +search(:accounts, "*:*").each do |account| + name = account["id"] + details = node[:accounts][:users][name] || {} + + if details[:status] and account["email"] + node.default[:exim][:aliases][name] = account["email"] + end +end + +if node[:exim][:private_aliases] + aliases = data_bag_item("exim", "aliases") + + aliases[node[:exim][:private_aliases]].each do |name,address| + node.default[:exim][:aliases][name] = address + end +end + template "/etc/aliases" do source "aliases.erb" owner "root"