summaryrefslogtreecommitdiffstats
path: root/roles/IMAP/templates/etc/postfix
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-07-10 05:39:25 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-07-10 05:40:30 +0200
commitd5927fb7247e881655488b850812e8186ae444a4 (patch)
treefc471cc247dceff6c6f0c0c29f41c414443688b9 /roles/IMAP/templates/etc/postfix
parentbf960a066466d7719ada8fe7bc3dec99d237b88a (diff)
Postfix lists/MDA instances: only include the MX:es' IPs in $mynetworks.
Diffstat (limited to 'roles/IMAP/templates/etc/postfix')
-rw-r--r--roles/IMAP/templates/etc/postfix/main.cf.j24
1 files changed, 3 insertions, 1 deletions
diff --git a/roles/IMAP/templates/etc/postfix/main.cf.j2 b/roles/IMAP/templates/etc/postfix/main.cf.j2
index faf17de..a879d28 100644
--- a/roles/IMAP/templates/etc/postfix/main.cf.j2
+++ b/roles/IMAP/templates/etc/postfix/main.cf.j2
@@ -19,7 +19,9 @@ append_dot_mydomain = no
mynetworks = 127.0.0.0/8, [::1]/128
{%- if groups.all | length > 1 -%}
- , {{ ipsec_subnet }}
+{%- for mx in groups.MX | sort -%}
+ , {{ ipsec[ hostvars[mx].inventory_hostname_short ] | ipaddr }}
+{%- endfor %}
{% endif %}
queue_directory = /var/spool/postfix-{{ postfix_instance[inst].name }}