diff --git a/admin/tool/messageinbound/classes/manager.php b/admin/tool/messageinbound/classes/manager.php index 8bb57ac54c1..a352f7c618d 100644 --- a/admin/tool/messageinbound/classes/manager.php +++ b/admin/tool/messageinbound/classes/manager.php @@ -103,6 +103,15 @@ class manager { 'debug' => empty($CFG->debugimap) ? null : fopen('php://stderr', 'w'), ); + if (strpos($configuration['hostspec'], ':')) { + $hostdata = explode(':', $configuration['hostspec']); + if (count($hostdata) === 2) { + // A hostname in the format hostname:port has been provided. + $configuration['hostspec'] = $hostdata[0]; + $configuration['port'] = $hostdata[1]; + } + } + $this->client = new \Horde_Imap_Client_Socket($configuration); try {