1 # Every one of our hosts has an MTA
3 # @param type exim4 or postfix. exim4 is our default MTA
4 # @param heavy receive email from the internet and thus do spam filtering etc
5 # @param mailrelay receive mail on other hosts' behalf. implies heavy
7 Enum['exim4', 'postfix'] $type = 'exim4',
8 Boolean $heavy = false,
9 Boolean $mailrelay = false,
13 include roles::mailrelay
19 $mxdata = dig($deprecated::nodeinfo, 'ldap', 'mxRecord')
20 if $mxdata and $mxdata =~ /INCOMING-MX/ {
21 $mailport = lookup('exim::mail_port')
23 @@concat::fragment { "manualroute-to-${::fqdn}":
24 tag => 'exim::manualroute::to::mailrelay',
25 target => '/etc/exim4/manualroute-new',
26 content => $mailport == undef ? {
27 true => "${::fqdn}: ${::fqdn}",
28 default => "${::fqdn}: ${::fqdn}::${mailport}",
33 } elsif $type == 'postfix' {
35 fail("Unsupported: mailrelay on type ${type}")
39 fail("Unexpected mta type ${type}")