]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/exim/recipes/default.rb
supybot: Add owl to watched repos
[chef.git] / cookbooks / exim / recipes / default.rb
index ff38860a0ab44295d3deb673ae47cace7180c9cb..b5b15080c0a15c615fc6aba0366389c9480a45ea 100644 (file)
@@ -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"