* This is where the mailboxes are listed. This controls most of what
* goes on in SquirrelMail.
*
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright 1999-2023 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
//xdebug_start_profiling("/var/spool/xdebug/right_main.txt");
-
/**
* Include the SquirrelMail initialization file.
*/
/* Open an imap connection */
-$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+global $imap_stream_options; // in case not defined in config
+$imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imap_stream_options);
$mailbox = (isset($mailbox) && $mailbox) ? $mailbox : 'INBOX';
/**
* Replace From => To in case it concerns a draft or sent folder
*/
-if (($mailbox == $sent_folder || $mailbox == $draft_folder) &&
- !in_array(SQM_COL_TO,$aMailboxPref[MBX_PREF_COLUMNS])) {
+if (handleAsSent($mailbox)
+ && !in_array(SQM_COL_TO,$aMailboxPref[MBX_PREF_COLUMNS])) {
$aNewOrder = array(); // nice var name ;)
foreach($aMailboxPref[MBX_PREF_COLUMNS] as $iCol) {
if ($iCol == SQM_COL_FROM) {
$sError = handleMessageListForm($imapConnection,$aMailbox);
if ($sError) {
$note = $sError;
+} else if (sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'POST') {
+ $preselected = array(); // clear pre-checked checkboxes when action succeeded
}
$compose_height = '550';
}
// do not use &, it will break the query string and $session will not be detected!!!
- $comp_uri = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
- '&session='.urlencode($aMailbox['FORWARD_SESSION']);
+ $comp_uri = $base_uri . 'src/compose.php?mailbox='. urlencode($mailbox)
+ . '&session='.urlencode($aMailbox['FORWARD_SESSION']['SESSION_NUMBER'])
+ . '&smaction=forward_as_attachment'
+ . '&fwduid=' . implode('_', $aMailbox['FORWARD_SESSION']['UIDS']);
$onload = "comp_in_new('$comp_uri', $compose_width, $compose_height);";
} else {
$mailbox_cache[$account.'_'.$aMailbox['NAME']] = $aMailbox;
sqsession_register($aMailbox,'aLastSelectedMailbox');
session_write_close();
// we have to redirect to the compose page
- $location = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
- '&session='.$aMailbox['FORWARD_SESSION'];
+ $location = $base_uri . 'src/compose.php?mailbox='. urlencode($mailbox)
+ . '&session='.$aMailbox['FORWARD_SESSION']['SESSION_NUMBER']
+ . '&smaction=forward_as_attachment'
+ . '&fwduid=' . implode('_', $aMailbox['FORWARD_SESSION']['UIDS']);
header("Location: $location");
exit;
}
$note = _("Your mail has been sent.");
}
if (isset($note)) {
- $oTemplate->assign('note', htmlspecialchars($note));
+ $oTemplate->assign('note', sm_encode_html_special_chars($note));
$oTemplate->display('note.tpl');
}