|
|
@ -153,15 +153,15 @@ class bootstrap |
|
|
|
} |
|
|
|
|
|
|
|
$imap_host = $rcmail->config->get('imap_host'); |
|
|
|
$imap_port = 143; |
|
|
|
$imap_ssl = false; |
|
|
|
|
|
|
|
$a_host = parse_url($imap_host); |
|
|
|
|
|
|
|
if (!empty($a_host['host'])) { |
|
|
|
$imap_host = $a_host['host']; |
|
|
|
$imap_ssl = isset($a_host['scheme']) && in_array($a_host['scheme'], ['ssl','imaps','tls']); |
|
|
|
$imap_port = $a_host['port'] ?? ($imap_ssl ? 993 : 143); |
|
|
|
} |
|
|
|
else { |
|
|
|
$imap_port = 143; |
|
|
|
$imap_ssl = false; |
|
|
|
$imap_ssl = isset($a_host['scheme']) && in_array($a_host['scheme'], ['ssl','imaps','tls']) ? $a_host['scheme'] : false; |
|
|
|
$imap_port = $a_host['port'] ?? ($imap_ssl && $imap_ssl != 'tls' ? 993 : 143); |
|
|
|
} |
|
|
|
|
|
|
|
if (!$imap->connect($imap_host, $username, $password, $imap_port, $imap_ssl)) { |
|
|
|