- Fixed sqsession_cookie function for setting HttpOnly cookie attribute.
- Reduce references header in a smart way to avoid "header too long"
errors from SMTP servers in really long threads (#1167754, #1465342).
+ - Added code that allows to use internal password functions in sqimap_login().
+ Switched plugins to use this code instead of accessing key and otp information
+ directly.
Version 1.5.1 (branched on 2006-02-12)
--------------------------------------
* Logs the user into the IMAP server. If $hide is set, no error messages
* will be displayed. This function returns the IMAP connection handle.
* @param string $username user name
- * @param string $password encrypted password
+ * @param string $password password encrypted with onetimepad. Since 1.5.2
+ * function can use internal password functions, if parameter is set to
+ * boolean false.
* @param string $imap_server_address address of imap server
* @param integer $imap_port port of imap server
* @param boolean $hide controls display connection errors
global $color, $squirrelmail_language, $onetimepad, $use_imap_tls,
$imap_auth_mech, $sqimap_capabilities;
- if (!isset($onetimepad) || empty($onetimepad)) {
- sqgetglobalvar('onetimepad' , $onetimepad , SQ_SESSION );
+ /* get imap login password */
+ if ($password===false) {
+ /* standard functions */
+ $password = sqauth_read_password();
+ } else {
+ /* old way. $key must be extracted from cookie */
+ if (!isset($onetimepad) || empty($onetimepad)) {
+ sqgetglobalvar('onetimepad' , $onetimepad , SQ_SESSION );
+ }
+ /* Decrypt the password */
+ $password = OneTimePadDecrypt($password, $onetimepad);
}
+
if (!isset($sqimap_capabilities)) {
sqgetglobalvar('sqimap_capabilities' , $capability , SQ_SESSION );
}
$imap_stream = sqimap_create_stream($imap_server_address,$imap_port,$use_imap_tls);
- /* Decrypt the password */
- $password = OneTimePadDecrypt($password, $onetimepad);
-
if (($imap_auth_mech == 'cram-md5') OR ($imap_auth_mech == 'digest-md5')) {
// We're using some sort of authentication OTHER than plain or login
$tag=sqimap_session_id(false);
* @return array all option information
*/
function load_optpage_data_folder() {
- global $username, $key, $imapServerAddress, $imapPort;
+ global $username, $imapServerAddress, $imapPort;
global $folder_prefix, $default_folder_prefix, $show_prefix_option;
/* Get some imap data we need later. */
- $imapConnection =
- sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
/* Build a simple array into which we will build options. */
/* GLOBALS */
sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
sqgetGlobalVar('submit', $submit, SQ_POST);
/* END GLOBALS */
-$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+$imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$caps_array = get_caps($imap_stream);
$list = array ('TEST_0',
'TEST_1',
$returnValue = '';
sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$read = sqimap_mailbox_select($imapConnection, $mailbox);
$start = gettimeofday();
$body = sqimap_run_command($imapConnection, "FETCH $passed_id RFC822",true, $response, $readmessage, TRUE);
global $optpage_data, $imapServerAddress, $imapPort, $show_contain_subfolders_option;
sqgetGlobalVar('username', $username, SQ_SESSION);
- sqgetGlobalVar('key', $key, SQ_COOKIE);
/* Get some imap data we need later. */
- $imapConnection =
- sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
sqimap_logout($imapConnection);
global $use_sent_subfolders, $move_to_sent;
sqgetGlobalVar('username', $username, SQ_SESSION);
- sqgetGlobalVar('key', $key, SQ_COOKIE);
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
if ($use_sent_subfolders || $move_to_sent) {
/* Auto-create folders, if they do not yet exist. */
if ($sent_subfolder != 'none') {
/* Create the imap connection. */
- $ic = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10);
+ $ic = sqimap_login($username, false, $imapServerAddress, $imapPort, 10);
$boxes = false;
/**
*/
function spamcop_while_sending_function() {
global $mailbox, $spamcop_delete, $spamcop_save, $spamcop_is_composing, $auto_expunge,
- $username, $key, $imapServerAddress, $imapPort;
+ $username, $imapServerAddress, $imapPort;
if (sqgetGlobalVar('spamcop_is_composing' , $spamcop_is_composing)) {
// delete spam message
if ($spamcop_delete) {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress,
- $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
sqimap_mailbox_select($imapConnection, $mailbox);
sqimap_msgs_list_delete($imapConnection, $mailbox, array($spamcop_is_composing));
if ($auto_expunge)
/* GLOBALS */
sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
exit();
}
- $imap_stream = sqimap_login($username, $key, $imapServerAddress,
- $imapPort, 0);
+ $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
sqimap_mailbox_select($imap_stream, $mailbox);
if ($spamcop_method == 'quick_email' ||