From 94563d73bdd58905af6a395ea67bf69c1d979218 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sun, 18 Oct 2020 19:48:37 +0200 Subject: [PATCH] Try to cleanup the conditionals that manage the postfix related rules. --- templates/iptables-rules.v4.j2 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/templates/iptables-rules.v4.j2 b/templates/iptables-rules.v4.j2 index 67a4fda..855da52 100644 --- a/templates/iptables-rules.v4.j2 +++ b/templates/iptables-rules.v4.j2 @@ -217,8 +217,7 @@ -A INPUT -m state --state NEW -s {{orientdb_hazelcast_multicast_group}} -p tcp -m tcp --dport {{ orientdb_hazelcast_multicast_port }} -j ACCEPT {% endif %} # Postfix -{% if postfix_relay_server is defined %} -{% if postfix_relay_server %} +{% if postfix_relay_server is defined and postfix_relay_server%} # # These are only needed on the machines that act as relay servers # @@ -235,10 +234,7 @@ -A OUTPUT -p tcp -m multiport --dports 25,587,465 -m state --state NEW -j LOG --log-prefix "LOCAL_DROPPED_SPAM " --log-uid -A OUTPUT -p tcp -m multiport --dports 25,587,465 -j DROP {% endif %} -{% endif %} -{% if postfix_relay_server is defined and not postfix_relay_server %} -{% if postfix_relay_client is defined%} -{% if postfix_relay_client %} +{% if postfix_relay_client is defined and postfix_relay_client%} # # When we are not a relay server but we want send email using our relay -A OUTPUT -p tcp -m multiport --dports 25,587,465 -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT @@ -252,8 +248,6 @@ -A OUTPUT -p tcp -m multiport --dports 25,587,465 -m state --state NEW -j LOG --log-prefix "LOCAL_DROPPED_SPAM " --log-uid -A OUTPUT -p tcp -m multiport --dports 25,587,465 -j DROP {% endif %} -{% endif %} -{% endif %} {% if iptables is defined %} {% if iptables.tcp_rules is defined and iptables.tcp_rules %} # TCP rules