PMCORE-4032

This commit is contained in:
Luciana Nuñez
2022-10-19 12:22:42 -04:00
parent 6a3d35c66a
commit 50d40d1b66

View File

@@ -449,18 +449,23 @@ class adminProxy extends HttpProxyController
$this->msg = $this->result ? '' : $Server->error; $this->msg = $this->result ? '' : $Server->error;
break; break;
case 3: //try to connect to host case 3: //try to connect to host
try {
if (preg_match('/^(.+):([0-9]+)$/', $srv, $hostinfo)) { if (preg_match('/^(.+):([0-9]+)$/', $srv, $hostinfo)) {
$server = $hostinfo[1]; $server = $hostinfo[1];
$port = $hostinfo[2]; $port = $hostinfo[2];
} else { } else {
$host = $srv; $server = $srv;
} }
$tls = (strtoupper($SMTPSecure) == 'tls'); $tls = (strtoupper($SMTPSecure) === 'TLS');
$ssl = (strtoupper($SMTPSecure) == 'ssl'); $ssl = (strtoupper($SMTPSecure) === 'SSL');
$this->success = $smtp->Connect(($ssl ? 'ssl://':'').$server, $port, $timeout); $this->success = $smtp->Connect(($ssl ? 'ssl://':'') . $server, $port, $timeout);
$this->msg = $this->result ? '' : $Server->error; $this->msg = $this->result ? '' : $Server->error;
} catch (Exception $e) {
$this->success = false;
$this->msg = $e->getMessage();
}
break; break;
case 4: //try login to host case 4: //try login to host
if ($auth_required == 'true') { if ($auth_required == 'true') {