From 56e12c731b03947629909649657db669eebc7a29 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 22 Sep 2019 11:39:09 +0200 Subject: [PATCH] Make the manualroute explicitly send to port 25 by default as that simplifies the logic here --- modules/roles/manifests/mta.pp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/roles/manifests/mta.pp b/modules/roles/manifests/mta.pp index d9bead43a..a8a64c6e2 100644 --- a/modules/roles/manifests/mta.pp +++ b/modules/roles/manifests/mta.pp @@ -27,17 +27,15 @@ class roles::mta( $mxdata = dig($deprecated::nodeinfo, 'ldap', 'mXRecord') + $mailport = lookup( { 'name' => 'exim::mail_port', 'default_value' => 25 } ) + if $mxdata and $mxdata.any |$item| { $item =~ /INCOMING-MX/ } { # a mail satellite. Gets mail via the mailrelays and sends out mail via the mail relays - $mailport = lookup( { 'name' => 'exim::mail_port', 'default_value' => undef } ) @@concat::fragment { "manualroute-to-${::fqdn}": tag => 'exim::manualroute::to::mailrelay', target => '/etc/exim4/manualroute', - content => $mailport == undef ? { - true => "${::fqdn}: ${::fqdn}", - default => "${::fqdn}: ${::fqdn}::${mailport}", - } + content => "${::fqdn}: ${::fqdn}::${mailport}", } @@ferm::rule::simple { "submission-from-${::fqdn}": @@ -47,10 +45,7 @@ class roles::mta( } Ferm::Rule::Simple <<| tag == 'smtp::server::to::mail-satellite' |>> { - port => $mailport == undef ? { - true => 25, - default => $mailport, - } + port => $mailport } } else { -- 2.20.1