From fc37442d21c3deb784f519ccb956e85e3fc67de6 Mon Sep 17 00:00:00 2001
From: andryyy <andre.peters@debinux.de>
Date: Wed, 22 Jan 2020 11:04:10 +0100
Subject: [PATCH] [Web] Fix transport validation for hostnames

---
 data/web/inc/ajax/transport_check.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/data/web/inc/ajax/transport_check.php b/data/web/inc/ajax/transport_check.php
index 2eec022c..da8c8e6c 100644
--- a/data/web/inc/ajax/transport_check.php
+++ b/data/web/inc/ajax/transport_check.php
@@ -50,8 +50,8 @@ if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admi
         $port = null;
       }
       else {
-        echo "Invalid transport";
-        die();
+        $port = substr($hostname_w_port, strrpos($hostname_w_port, ':') + 1);
+        $hostname = rtrim($hostname_w_port, ':' . $port);
       }
     }
     // Try to get MX if host is not [host]