From 204fd68b6f130aece61b12f37e7390f9277be9a1 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 10 Jan 2020 11:43:46 +0100 Subject: [PATCH] write_transport_map: code cleanup Signed-off-by: Thomas Lamprecht Originally-by: Stoiko Ivanov --- src/PMG/Config.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm index 0d9c65e..5b5f03f 100755 --- a/src/PMG/Config.pm +++ b/src/PMG/Config.pm @@ -1179,14 +1179,12 @@ sub write_transport_map { my $use_mx = $data->{use_mx}; $use_mx = 0 if $data->{host} =~ m/^(?:$IPV4RE|$IPV6RE)$/; - my $is_lmtp = 0; - $is_lmtp = 1 if $data->{protocol} eq "lmtp"; - - if ($is_lmtp) { - $data->{protocol} = "lmtp:inet"; + if ($data->{protocol} eq 'lmtp') { + $use_mx = 1; + $data->{protocol} .= ":inet"; } - if ($use_mx or $is_lmtp) { + if ($use_mx) { PVE::Tools::safe_print( $filename, $fh, "$data->{domain} $data->{protocol}:$data->{host}:$data->{port}\n"); } else { -- 2.39.2