Mercurial > repos > other > Puppet
comparison modules/postfix/templates/master.cf.epp @ 326:63e0b5149cfb
Add fallback relays to Postfix
This allows us to reliably send to IPv4 servers via Mythic-Beasts'
mailserver rather than getting random IPs from the NAT64 servers.
The firewall rules should ensure Postfix doesn't try to send
email out via NAT64 and falls back to the relay. IPv6 will still
go directly.
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 07 Mar 2020 14:29:34 +0000 |
parents | 6d719622c72f |
children | 38bb323e8231 |
comparison
equal
deleted
inserted
replaced
325:49b7689da25b | 326:63e0b5149cfb |
---|---|
1 <%- | | 1 <%- | |
2 Stdlib::IP::Address $mailserver_ip, | 2 Stdlib::IP::Address $mailserver_ip, |
3 Optional[Stdlib::IP::Address] $mailserver_proxy = undef, | 3 Optional[Stdlib::IP::Address] $mailserver_proxy = undef, |
4 Stdlib::IP::Address $lo_ip, | 4 Stdlib::IP::Address $lo_ip, |
5 Stdlib::IP::Address $lo_networks, | 5 Stdlib::IP::Address $lo_networks, |
6 Optional[Array[Stdlib::Host]] $fallback_relays = [] | |
6 | | 7 | |
7 -%> | 8 -%> |
8 # | 9 # |
9 # Postfix master process configuration file. For details on the format | 10 # Postfix master process configuration file. For details on the format |
10 # of the file, see the master(5) manual page (command: "man 5 master"). | 11 # of the file, see the master(5) manual page (command: "man 5 master"). |
74 smtp unix - - n - - smtp | 75 smtp unix - - n - - smtp |
75 <%- if $mailserver_ip =~ Stdlib::IP::Address::V6 { -%> | 76 <%- if $mailserver_ip =~ Stdlib::IP::Address::V6 { -%> |
76 -o smtp_bind_address6=<%= $mailserver_ip %> | 77 -o smtp_bind_address6=<%= $mailserver_ip %> |
77 <%- } else { -%> | 78 <%- } else { -%> |
78 -o smtp_bind_address=<%= $mailserver_ip %> | 79 -o smtp_bind_address=<%= $mailserver_ip %> |
80 <%- } -%> | |
81 <%- if size($fallback_relays) > 0 { -%> | |
82 -o smtp_fallback_relays=<%= join($fallback_relays.map |$relay| { "[$relay]" }, ", ") %> | |
79 <%- } -%> | 83 <%- } -%> |
80 # When relaying mail as backup MX, disable fallback_relay to avoid MX loops | 84 # When relaying mail as backup MX, disable fallback_relay to avoid MX loops |
81 relay unix - - n - - smtp | 85 relay unix - - n - - smtp |
82 -o smtp_fallback_relay= | 86 -o smtp_fallback_relay= |
83 # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 | 87 # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 |