diff options
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/main.inc | 2 | ||||
-rw-r--r-- | program/include/rcube_imap.inc | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 1e25dd6d1..61a9c9cd1 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -562,7 +562,7 @@ function rcmail_login($user, $pass, $host=NULL) if ($a_host['host']) { $host = $a_host['host']; - $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE; + $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 diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc index 1f94adcd1..f7584041a 100644 --- a/program/include/rcube_imap.inc +++ b/program/include/rcube_imap.inc @@ -97,17 +97,17 @@ class rcube_imap * @param string Username for IMAP account * @param string Password for IMAP account * @param number Port to connect to - * @param boolean Use SSL connection + * @param string SSL schema (either ssl or tls) or null if plain connection * @return boolean TRUE on success, FALSE on failure * @access public */ - function connect($host, $user, $pass, $port=143, $use_ssl=FALSE) + function connect($host, $user, $pass, $port=143, $use_ssl=null) { global $ICL_SSL, $ICL_PORT, $IMAP_USE_INTERNAL_DATE; // check for Open-SSL support in PHP build if ($use_ssl && in_array('openssl', get_loaded_extensions())) - $ICL_SSL = TRUE; + $ICL_SSL = $use_ssl == 'imaps' ? 'ssl' : $use_ssl; else if ($use_ssl) { raise_error(array('code' => 403, 'type' => 'imap', 'file' => __FILE__, |