summaryrefslogtreecommitdiff
path: root/roundcubemail/installer
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-06 08:35:45 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-06 08:35:45 +0000
commit10b740c4aaf4eaca344797aefbb578aaaacf97e9 (patch)
treec2456b74660887f43fa0d3a54e8f7004924f7bdf /roundcubemail/installer
parent59787216637a7b1f9daba50227c3d426de2343c8 (diff)
- Fixed imap test to non-default port when using ssl (#1488118)
git-svn-id: https://svn.roundcube.net/trunk@5312 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/installer')
-rw-r--r--roundcubemail/installer/test.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/roundcubemail/installer/test.php b/roundcubemail/installer/test.php
index 02a1cebe2..2dd330531 100644
--- a/roundcubemail/installer/test.php
+++ b/roundcubemail/installer/test.php
@@ -382,18 +382,20 @@ $pass_field = new html_passwordfield(array('name' => '_pass', 'id' => 'imappass'
<?php
if (isset($_POST['imaptest']) && !empty($_POST['_host']) && !empty($_POST['_user'])) {
-
+
echo '<p>Connecting to ' . Q($_POST['_host']) . '...<br />';
-
- $a_host = parse_url($_POST['_host']);
+
+ $imap_host = trim($_POST['_host']);
+ $imap_port = $RCI->getprop('default_port');
+ $a_host = parse_url($imap_host);
+
if ($a_host['host']) {
$imap_host = $a_host['host'];
- $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;
- $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']);
- }
- else {
- $imap_host = trim($_POST['_host']);
- $imap_port = $RCI->getprop('default_port');
+ $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null;
+ if (isset($a_host['port']))
+ $imap_port = $a_host['port'];
+ else if ($imap_ssl && $imap_ssl != 'tls' && (!$imap_port || $imap_port == 143))
+ $imap_port = 993;
}
$imap_host = idn_to_ascii($imap_host);