Files @ 441a70c073b9
Branch filter:

Location: majic-ansible-roles/roles/mail_forwarder/templates/ferm_mail.conf.j2

branko
MAR-232: Switch to using IP addreses in firewall rules for mail_forwarder role:

- Perform lookups on managed machine for the passed-in SMTP relay
host, and use those values when populating the firewall rules.
{% if smtp_relay_host and smtp_from_relay_allowed %}
{% if smtp_relay_host_ipv4 %}
domain ip {
    # Accept incoming connections on port 25 from SMTP relay host.
    table filter {
        chain INPUT {
            # SMTP for server communication.
            proto tcp dport 25 {
{% for address in smtp_relay_host_ipv4 %}
                saddr {{ address }} ACCEPT;
{% endfor %}
            }
        }
    }
}
{% endif %}

{% if smtp_relay_host_ipv6 %}
domain ip6 {
    # Accept incoming connections on port 25 from SMTP relay host.
    table filter {
        chain INPUT {
            # SMTP for server communication.
            proto tcp dport 25 {
{% for address in smtp_relay_host_ipv6 %}
                saddr {{ address }} ACCEPT;
{% endfor %}
            }
        }
    }
}
{% endif %}
{% endif %}