*
* This impliments all functions that manipulate mailboxes
*
- * $Id$
+ * @version $Id$
* @package squirrelmail
+ * @subpackage imap
*/
/** UTF7 support */
$mailbox, $mbx_response, $auto_expunge,
$sort, $allow_server_sort, $thread_sort_messages, $allow_thread_sort,
$username, $data_dir;
+ $cnt = 0;
// Got to grab this out of prefs, since it isn't saved from mailbox_view.php
if ($allow_thread_sort) {
break;
}
}
+
+ if ( isset($msgs) ) {
+ unset($msgs[$i]);
+ $msgs = array_values($msgs);
+ sqsession_register($msgs, 'msgs');
+ }
- unset($msgs[$i]);
- unset($msort[$i]);
-
- $msgs = array_values($msgs);
- $msort = array_values($msort);
-
- sqsession_register($msgs, 'msgs');
- sqsession_register($msort, 'msort');
+ if ( isset($msort) ) {
+ unset($msort[$i]);
+ $msort = array_values($msort);
+ sqsession_register($msort, 'msort');
+ }
if ($auto_expunge) {
- sqimap_mailbox_expunge($imapConnection, $mailbox, true);
+ $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
}
// And after all that mucking around, update the sort list!
} else {
$server_sort_array = sqimap_get_php_sort_order($imapConnection, $mbx_response);
}
-
+ return $cnt;
}
/**
* Selects a mailbox
*/
function sqimap_mailbox_select ($imap_stream, $mailbox) {
- global $auto_expunge;
-
if ($mailbox == 'None') {
return;
}
$result['RIGHTS']=$regs[1];
}
- if ($auto_expunge) {
- $tmp = sqimap_run_command($imap_stream, 'EXPUNGE', false, $a, $b);
- }
return $result;
}
/**
* Subscribes to an existing folder.
*/
-function sqimap_subscribe ($imap_stream, $mailbox) {
+function sqimap_subscribe ($imap_stream, $mailbox,$debug=true) {
$read_ary = sqimap_run_command($imap_stream, 'SUBSCRIBE ' .
sqimap_encode_mailbox_name($mailbox),
- true, $response, $message);
+ $debug, $response, $message);
}
/**
* See comment on sqimap_mailbox_parse() for info about the returned array.
*/
function sqimap_mailbox_list($imap_stream) {
+ echo "TEST<BR>";
global $default_folder_prefix;
if (!isset($boxesnew)) {