]> git.proxmox.com Git - pmg-api.git/commitdiff
write_transport_map: code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 Jan 2020 10:43:46 +0000 (11:43 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 10 Jan 2020 10:44:43 +0000 (11:44 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Originally-by: Stoiko Ivanov <s.ivanov@proxmox.com>
src/PMG/Config.pm

index 0d9c65eb2a87713d6314af0546d92ad37a5e98d6..5b5f03fae076dbb4c3925927f8e71a21952662b5 100755 (executable)
@@ -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 {