]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/exim/recipes/default.rb
Fix some foodcritic complaints
[chef.git] / cookbooks / exim / recipes / default.rb
index 9c687a3c9cdc118e119d96a1e417b474264bc79e..099e047c6cc1b821a8f13816a53455aeae3ef291 100644 (file)
@@ -61,14 +61,14 @@ end
 relay_to_domains = node[:exim][:relay_to_domains]
 
 node[:exim][:routes].each_value do |route|
-  relay_to_domains = relay_to_domains | route[:domains] if route[:host]
+  relay_to_domains |= route[:domains] if route[:host]
 end
 
 relay_from_hosts = node[:exim][:relay_from_hosts]
 
 if node[:exim][:smarthost_name]
   search(:node, "exim_smarthost_via:#{node[:exim][:smarthost_name]}\\:*").each do |host|
-    relay_from_hosts = relay_from_hosts | host.ipaddresses(:role => :external)
+    relay_from_hosts |= host.ipaddresses(:role => :external)
   end
 end
 
@@ -144,12 +144,11 @@ else
   end
 end
 
-if node[:exim][:smarthost_via]
-  firewall_rule "deny-outbound-smtp" do
-    action :reject
-    source "fw"
-    dest "net"
-    proto "tcp:syn"
-    dest_ports "smtp"
-  end
+firewall_rule "deny-outbound-smtp" do
+  action :reject
+  source "fw"
+  dest "net"
+  proto "tcp:syn"
+  dest_ports "smtp"
+  only_if { node[:exim][:smarthost_via] }
 end