//
if ($reply_id) {
global $imapConnection, $username, $imapServerAddress,
- $imapPort, $mailbox;
+ $imapPort, $imapSslOptions, $mailbox;
// try our best to use an existing IMAP handle
//
} else {
$close_imap_stream = TRUE;
- $my_imap_stream = sqimap_login($username, FALSE,
- $imapServerAddress, $imapPort, 0);
+ $my_imap_stream = sqimap_login($username, FALSE, $imapServerAddress,
+ $imapPort, 0, $imapSslOptions);
}
sqimap_mailbox_select($my_imap_stream, $mailbox);
* @param string $pass password to log into the SMTP server with
* @param boolean $authpop whether or not to use POP-before-SMTP authorization
* @param string $pop_host host name or IP to connect to for POP-before-SMTP authorization
+ * @param array $ssl_options SSL context options, see config_local.php for more details (OPTIONAL)
*
* @return handle $stream file handle resource to SMTP stream
*/
- function initStream($message, $domain, $length=0, $host='', $port='', $user='', $pass='', $authpop=false, $pop_host='') {
+ function initStream($message, $domain, $length=0, $host='', $port='', $user='', $pass='', $authpop=false, $pop_host='', $ssl_options=array()) {
return $stream;
}
}
}
- function initStream($message, $domain, $length=0, $host='', $port='', $user='', $pass='', $authpop=false, $pop_host='') {
+ function initStream($message, $domain, $length=0, $host='', $port='', $user='', $pass='', $authpop=false, $pop_host='', $ssl_options=array()) {
global $use_smtp_tls,$smtp_auth_mech;
if ($authpop) {
$from->mailbox = '';
}
+ // NB: Using "ssl://" ensures the highest possible TLS version
+ // will be negotiated with the server (whereas "tls://" only
+ // uses TLS version 1.0)
+ //
if ($use_smtp_tls == 1) {
if ((check_php_version(4,3)) && (extension_loaded('openssl'))) {
- $stream = @fsockopen('tls://' . $host, $port, $errorNumber, $errorString);
+ if (function_exists('stream_socket_client')) {
+ $server_address = 'ssl://' . $host . ':' . $port;
+ if (!empty($ssl_options))
+ $ssl_options = array('ssl' => $ssl_options);
+ $ssl_context = @stream_context_create($ssl_options);
+ $connect_timeout = ini_get('default_socket_timeout');
+ // null timeout is broken
+ if ($connect_timeout == 0)
+ $connect_timeout = 30;
+ $stream = @stream_socket_client($server_address, $errorNumber, $errorString, $connect_timeout, STREAM_CLIENT_CONNECT, $ssl_context);
+ } else {
+ $stream = @fsockopen('ssl://' . $host, $port, $errorNumber, $errorString);
+ }
$this->tls_enabled = true;
} else {
/**
* @return resource
* @access public
*/
- function initStream($message, $sendmail_path, $ignore=0, $ignore='', $ignore='', $ignore='', $ignore='', $ignore=false, $ignore='') {
+ function initStream($message, $sendmail_path, $ignore=0, $ignore='', $ignore='', $ignore='', $ignore='', $ignore=false, $ignore='', $ignore=array()) {
$rfc822_header = $message->rfc822_header;
$from = $rfc822_header->from[0];
$envelopefrom = trim($from->mailbox.'@'.$from->host);
* of custom PHP session handlers. This feature is well
* documented in the code in include/init.php
*
- * hide_squirrelmail_header (must be defined as a constant:
+ * $hide_squirrelmail_header (must be defined as a constant:
* define('hide_squirrelmail_header', 1);
* This allows the administrator to force SquirrelMail never
* to add its own Received headers with user information in
* (those that are displayed in a different color than other
* "normal" mailboxes).
*
+ * $smtpSslOptions allows more control over the SSL context used
+ * when connecting to the SMTP server over SSL/TLS. See:
+ * http://php.net/manual/context.ssl.php
+ * For example, you can specify a CA file that corresponds
+ * to your server's certificate and make sure that the
+ * server's certificate is validated when connecting:
+ * $smtpSslOptions = array(
+ * 'cafile' => '/etc/pki/tls/certs/ca-bundle.crt',
+ * 'verify_peer' => true,
+ * 'verify_depth' => 3,
+ * );
+ *
+ * $imapSslOptions allows more control over the SSL context used
+ * when connecting to the IMAP server over SSL/TLS. See:
+ * http://php.net/manual/context.ssl.php
+ * For example, you can specify a CA file that corresponds
+ * to your server's certificate and make sure that the
+ * server's certificate is validated when connecting:
+ * $imapSslOptions = array(
+ * 'cafile' => '/etc/pki/tls/certs/ca-bundle.crt',
+ * 'verify_peer' => true,
+ * 'verify_depth' => 3,
+ * );
*/
unsafe images.
- Full date and time is used as "title" (mouseover) text for dates
shown on the message list screen
+ - Added advanced control over the SSL context used when connecting
+ to the SMTP and IMAP servers over SSL/TLS (Thanks to Emmanuel
+ Dreyfus). See $imapSslOptions and $smtpSslOptions in config_local.php
+ for more information.
Version 1.5.1 (branched on 2006-02-12)
--------------------------------------
* @param int port port number to connect to
* @param integer $tls whether to use plain text(0), TLS(1) or STARTTLS(2) when connecting.
* Argument was boolean before 1.5.1.
+ * @param array $ssl_options SSL context options, see config_local.php
+ * for more details (OPTIONAL)
* @return imap-stream resource identifier
* @since 1.5.0 (usable only in 1.5.1 or later)
*/
-function sqimap_create_stream($server,$port,$tls=0) {
+function sqimap_create_stream($server,$port,$tls=0,$ssl_options=array()) {
global $squirrelmail_language;
if (strstr($server,':') && ! preg_match("/^\[.*\]$/",$server)) {
$server = '['.$server.']';
}
+ // NB: Using "ssl://" ensures the highest possible TLS version
+ // will be negotiated with the server (whereas "tls://" only
+ // uses TLS version 1.0)
+ //
if ($tls == 1) {
if ((check_php_version(4,3)) and (extension_loaded('openssl'))) {
- /* Use TLS by prefixing "tls://" to the hostname */
- $server = 'tls://' . $server;
+ if (function_exists('stream_socket_client')) {
+ $server_address = 'ssl://' . $server . ':' . $port;
+ if (!empty($ssl_options))
+ $ssl_options = array('ssl' => $ssl_options);
+ $ssl_context = @stream_context_create($ssl_options);
+ $connect_timeout = ini_get('default_socket_timeout');
+ // null timeout is broken
+ if ($connect_timeout == 0)
+ $connect_timeout = 15;
+ $imap_stream = @stream_socket_client($server_address, $error_number, $error_string, $connect_timeout, STREAM_CLIENT_CONNECT, $ssl_context);
+ } else {
+ $imap_stream = @fsockopen('ssl://' . $server, $port, $error_number, $error_string, 15);
+ }
} else {
require_once(SM_PATH . 'functions/display_messages.php');
logout_error( sprintf(_("Error connecting to IMAP server: %s."), $server).
_("Please contact your system administrator and report this error."),
sprintf(_("Error connecting to IMAP server: %s."), $server));
}
+ } else {
+ $imap_stream = @fsockopen($server, $port, $error_number, $error_string, 15);
}
- $imap_stream = @fsockopen($server, $port, $error_number, $error_string, 15);
/* Do some error correction */
if (!$imap_stream) {
* 1 = show no errors (just exit)
* 2 = show no errors (return FALSE)
* 3 = show no errors (return error string)
+ * @param array $ssl_options SSL context options, see config_local.php
+ * for more details (OPTIONAL)
* @return mixed The IMAP connection stream, or if the connection fails,
* FALSE if $hide is set to 2 or an error string if $hide
* is set to 3.
*/
-function sqimap_login ($username, $password, $imap_server_address, $imap_port, $hide) {
+function sqimap_login ($username, $password, $imap_server_address,
+ $imap_port, $hide, $ssl_options=array()) {
global $color, $squirrelmail_language, $onetimepad, $use_imap_tls,
$imap_auth_mech, $sqimap_capabilities;
$host = $imap_server_address;
$imap_server_address = sqimap_get_user_server($imap_server_address, $username);
- $imap_stream = sqimap_create_stream($imap_server_address,$imap_port,$use_imap_tls);
+ $imap_stream = sqimap_create_stream($imap_server_address,$imap_port,$use_imap_tls,$ssl_options);
if (($imap_auth_mech == 'cram-md5') OR ($imap_auth_mech == 'digest-md5')) {
// We're using some sort of authentication OTHER than plain or login
* @return array all option information
*/
function load_optpage_data_folder() {
- global $username, $imapServerAddress, $imapPort, $oTemplate, $nbsp,
- $folder_prefix, $default_folder_prefix, $show_prefix_option;
+ global $username, $imapServerAddress, $imapPort, $imapSslOptions,
+ $oTemplate, $nbsp, $folder_prefix, $default_folder_prefix,
+ $show_prefix_option;
/* Get some imap data we need later. */
- $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$boxes = sqimap_mailbox_list($imapConnection);
/* Build a simple array into which we will build options. */
* @access private
*/
function start_filters($hook_args) {
- global $imapServerAddress, $imapPort, $imap_stream, $imapConnection,
- $UseSeparateImapConnection, $AllowSpamFilters, $filter_inbox_count,
- $username;
+ global $imapServerAddress, $imapPort, $imapSslOptions, $imap_stream,
+ $imapConnection, $UseSeparateImapConnection, $AllowSpamFilters,
+ $filter_inbox_count, $username;
/**
* check hook that calls filtering. If filters are called by right_main_after_header,
if ((!isset($imap_stream) && !isset($imapConnection)) ||
$UseSeparateImapConnection ) {
$stream = sqimap_login($username, false, $imapServerAddress,
- $imapPort, 10);
+ $imapPort, 10, $imapSslOptions);
$previously_connected = false;
} else if (isset($imapConnection)) {
$stream = $imapConnection;
sqgetGlobalVar('theid', $theid);
sqgetGlobalVar('action', $action, SQ_GET);
+global $imapSslOptions; // in case not defined in config
if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
if (isset($action) && ($action == 'add' || $action == 'edit')) {
- $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$boxes = sqimap_mailbox_list($imapConnection);
for ($a = 0, $cnt = count($boxes); $a < $cnt; $a++) {
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
sqgetGlobalVar('action', $action, SQ_GET);
+global $imapSslOptions; // in case not defined in config
/* end globals */
displayPageHeader($color);
if (isset($action) && $action == 'spam') {
- $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$boxes = sqimap_mailbox_list($imapConnection);
sqimap_logout($imapConnection);
$numboxes = count($boxes);
/* END GLOBALS */
-$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$caps_array = get_caps($imap_stream);
$list = array ('TEST_0',
'TEST_1',
/* globals */
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+global $imapSslOptions; // in case not defined in config
/* end globals */
/**
}
Mail_Fetch_Status(_("Opening IMAP server"));
- $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 10);
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 10, $imapSslOptions);
// check if destination folder is not set, is not subscribed and is not \noselect folder
if($mailfetch_subfolder == '' ||
function mail_fetch_login_function() {
include_once (SM_PATH . 'functions/imap_general.php');
- global $username, $data_dir, $imapServerAddress, $imapPort;
+ global $username, $data_dir, $imapServerAddress, $imapPort, $imapSslOptions;
$mailfetch_newlog = getPref($data_dir, $username, 'mailfetch_newlog');
continue;
}
- $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 10);
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 10, $imapSslOptions);
/* log into pop server*/
if (! $pop3->login($mailfetch_user, $mailfetch_pass)) {
$mf_port = trim($mf_port);
$mf_server = trim($mf_server);
+global $imapSslOptions; // in case not defined in config
/* end globals */
html_tag( 'tr' ) .
html_tag( 'th', _("Store in Folder:"), 'right' ) .
html_tag( 'td', '', 'left' );
- $imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$boxes = sqimap_mailbox_list($imapConnection);
echo '<select name="mf_subfolder">';
html_tag( 'th', _("Store in Folder:"), 'right' ) .
html_tag( 'td', '', 'left' );
- $imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$boxes = sqimap_mailbox_list($imapConnection);
echo '<select name="mf_subfolder">';
$selected = 0;
* @access public
*/
function get_message_details($mailbox, $passed_id, $passed_ent_id=0, $stripHTML=FALSE) {
- global $imapServerAddress, $imapPort, $color,$msgd_8bit_in_hex, $username;
+ global $imapServerAddress, $imapPort, $imapSslOptions,
+ $color,$msgd_8bit_in_hex, $username;
$returnValue = '';
- $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$read = sqimap_mailbox_select($imapConnection, $mailbox);
if (!empty($passed_ent_id))
$body = sqimap_run_command($imapConnection, "FETCH $passed_id BODY[$passed_ent_id]",true, $response, $readmessage, TRUE);
function sent_subfolders_optpage_loadhook_folders_do() {
global $data_dir, $username, $optpage_data, $imapServerAddress,
- $imapPort, $show_contain_subfolders_option, $sent_folder;
+ $imapPort, $imapSslOptions, $show_contain_subfolders_option, $sent_folder;
/* Get some imap data we need later. */
- $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$boxes = sqimap_mailbox_list($imapConnection);
sqimap_logout($imapConnection);
function sent_subfolders_update_sentfolder_do() {
global $sent_folder, $username,
$data_dir, $imapServerAddress, $imapPort,
- $move_to_sent;
+ $imapSslOptions, $move_to_sent;
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
/* Auto-create folders, if they do not yet exist. */
if ($sent_subfolder != 'none') {
/* Create the imap connection. */
- $ic = sqimap_login($username, false, $imapServerAddress, $imapPort, 10);
+ $ic = sqimap_login($username, false, $imapServerAddress, $imapPort, 10, $imapSslOptions);
$boxes = false;
/**
*/
function spamcop_while_sending_function() {
global $mailbox, $spamcop_delete, $spamcop_save, $spamcop_is_composing, $auto_expunge,
- $username, $imapServerAddress, $imapPort;
+ $username, $imapServerAddress, $imapPort, $imapSslOptions;
if (sqgetGlobalVar('spamcop_is_composing' , $spamcop_is_composing)) {
// delete spam message
if ($spamcop_delete) {
- $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
sqimap_mailbox_select($imapConnection, $mailbox);
sqimap_msgs_list_delete($imapConnection, $mailbox, array($spamcop_is_composing));
if ($auto_expunge)
exit();
}
- $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ global $imapSslOptions; // in case not defined in config
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
sqimap_mailbox_select($imap_stream, $mailbox);
if ($spamcop_method == 'quick_email' ||
require_once(SM_PATH . 'functions/addressbook.php');
require_once(SM_PATH . 'functions/forms.php');
require_once(SM_PATH . 'functions/identity.php');
+global $imapSslOptions; // in case not defined in config
/* --------------------- Get globals ------------------------------------- */
$draft_message = _("Draft Email Saved");
/* If this is a resumed draft, then delete the original */
if(isset($delete_draft)) {
- $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, false);
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, false, $imapSslOptions);
sqimap_mailbox_select($imap_stream, $draft_folder);
// force bypass_trash=true because message should be saved when deliverMessage() returns true.
// in current implementation of sqimap_msgs_list_flag() single message id can
/* if it is resumed draft, delete draft message */
if ( isset($delete_draft)) {
- $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, false);
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, false, $imapSslOptions);
sqimap_mailbox_select($imap_stream, $draft_folder);
// bypass_trash=true because message should be saved when deliverMessage() returns true.
// in current implementation of sqimap_msgs_list_flag() single message id can
function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $session='') {
global $editor_size, $default_use_priority, $body, $idents,
$use_signature, $data_dir, $username,
- $key, $imapServerAddress, $imapPort,
+ $key, $imapServerAddress, $imapPort, $imapSslOptions,
$composeMessage, $body_quote, $request_mdn, $request_dr,
$mdn_user_support, $languages, $squirrelmail_language,
$default_charset, $do_not_reply_to_self;
if ($passed_id) {
$imapConnection = sqimap_login($username, false, $imapServerAddress,
- $imapPort, 0);
+ $imapPort, 0, $imapSslOptions);
sqimap_mailbox_select($imapConnection, $mailbox);
$message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
$username, $identity, $idents, $data_dir,
$request_mdn, $request_dr, $default_charset, $useSendmail,
$domain, $action, $default_move_to_sent, $move_to_sent,
- $imapServerAddress, $imapPort, $sent_folder, $key;
+ $imapServerAddress, $imapPort, $imapSslOptions, $sent_folder, $key;
$rfc822_header = $composeMessage->rfc822_header;
if (!$useSendmail && !$draft) {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
- global $smtpServerAddress, $smtpPort, $pop_before_smtp, $pop_before_smtp_host;
+ global $smtpServerAddress, $smtpPort, $smtpSslOptions, $pop_before_smtp, $pop_before_smtp_host;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
if (empty($pop_before_smtp_host)) $pop_before_smtp_host = $smtpServerAddress;
get_smtp_user($user, $pass);
$stream = $deliver->initStream($composeMessage,$domain,0,
- $smtpServerAddress, $smtpPort, $user, $pass, $authPop, $pop_before_smtp_host);
+ $smtpServerAddress, $smtpPort, $user, $pass, $authPop, $pop_before_smtp_host, $smtpSslOptions);
} elseif (!$draft) {
require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
global $sendmail_path, $sendmail_args;
} elseif ($draft) {
global $draft_folder;
$imap_stream = sqimap_login($username, false, $imapServerAddress,
- $imapPort, 0);
+ $imapPort, 0, $imapSslOptions);
if (sqimap_mailbox_exists ($imap_stream, $draft_folder)) {
require_once(SM_PATH . 'class/deliver/Deliver_IMAP.class.php');
$imap_deliver = new Deliver_IMAP();
plain_error_message($msg);
} else {
unset ($deliver);
- $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
// mark as replied or forwarded if applicable
/* end globals */
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$aMailbox = sqm_api_mailbox_select($imapConnection, $account, $mailbox,array(),array());
if (isset($aMailbox['MSG_HEADERS'][$passed_id]['MESSAGE_OBJECT']) &&
sqgetGlobalVar('smtoken', $submitted_token, SQ_GET, '');
sm_validate_security_token($submitted_token, -1, TRUE);
-$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$mailbox = $trash_folder;
$boxes = sqimap_mailbox_list($imap_stream);
/* end of get globals */
-$imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
/* switch to the right function based on what the user selected */
if ( sqgetGlobalVar('smaction', $action, SQ_POST) ) {
// open a connection on the imap port (143)
// why hide the output?
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, true);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, true, $imapSslOptions);
/**
* Using stristr since very old preferences may contain "None" and "none".
}
/* Verify that username and password are correct. */
-$imapConnection = sqimap_login($login_username, $key, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login($login_username, $key, $imapServerAddress, $imapPort, 0, $imapSslOptions);
/* From now on we are logged it. If the login failed then sqimap_login handles it */
/**
/* Open an imap connection */
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$mailbox = (isset($mailbox) && $mailbox) ? $mailbox : 'INBOX';
uasort($imap_asearch_options, 'asearch_unhtml_strcoll');
/* open IMAP connection */
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
/* get mailboxes once here */
sqgetGlobalVar('startMessage', $startMessage, SQ_GET);
/* end globals */
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
sqimap_mailbox_select($imapConnection, $mailbox);
displayPageHeader($color);
}
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+global $imapSslOptions; // in case not defined in config
$imapConnection = sqimap_login($username, false, $imapServerAddress,
- $imapPort, 0);
+ $imapPort, 0, $imapSslOptions);
$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true);
$header = parse_viewheader($imapConnection,$passed_id, $passed_ent_id);
// TODO: add required var checks here.
-$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$mbx_response = sqimap_mailbox_select($imap_stream, $mailbox);
$message = &$messages[$mbx_response['UIDVALIDITY']][$passed_id];
sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER);
sqgetGlobalVar('passed_id', $passed_id, SQ_GET, NULL, SQ_TYPE_BIGINT);
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imapSslOptions; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);
$message = &$messages[$mbx_response['UIDVALIDITY']][$passed_id];