sqimap_mailbox_select ($imap_stream, $mailbox);
fputs ($imap_stream, "a001 EXPUNGE\r\n");
$read = sqimap_read_data($imap_stream, "a001", $handle_errors, $response, $message);
- sqimap_mailbox_close ($imap_stream);
}
}
}
- /******************************************************************************
- ** Closes an open mailbox
- ******************************************************************************/
- function sqimap_mailbox_close ($imap_stream) {
- fputs ($imap_stream, "a001 CLOSE\r\n");
- $tmp = sqimap_read_data($imap_stream, "a001", false, $response, $message);
- }
-
/******************************************************************************
** Selects a mailbox
******************************************************************************/
fputs ($imap_stream, "a001 LSUB \"\" \"*\"\r\n");
$lsub_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
+ /** OS: we don't want to parse last element of array, 'cause it is OK command, so we unset it **/
+ unset($lsub_ary[count($lsub_ary)-1]);
+
for ($i=0;$i < count($lsub_ary); $i++) {
$sorted_lsub_ary[$i] = find_mailbox_name($lsub_ary[$i]);
if ($sorted_lsub_ary[$i] == "INBOX")
// Then list special folders and their subfolders
for ($i = 0 ; $i <= count($boxes) ; $i++) {
- if((eregi("^".$trash_folder.'$', $boxes[$i]["unformatted"]) ||
- eregi("^".$trash_folder.quotemeta($dm), $boxes[$i]["unformatted"]) ) &&
+ if((eregi("^".quotemeta($trash_folder).'$', $boxes[$i]["unformatted"]) ||
+ eregi("^".quotemeta($trash_folder).quotemeta($dm), $boxes[$i]["unformatted"]) ) &&
($move_to_trash)) {
$boxesnew[] = $boxes[$i];
$boxes[$i]["used"] = true;
}
- else if((eregi("^".$sent_folder.'$', $boxes[$i]["unformatted"]) ||
- eregi("^".$sent_folder.quotemeta($dm), $boxes[$i]["unformatted"]) ) &&
+ else if((eregi("^".quotemeta($sent_folder).'$', $boxes[$i]["unformatted"]) ||
+ eregi("^".quotemeta($sent_folder).quotemeta($dm), $boxes[$i]["unformatted"]) ) &&
($move_to_sent)) {
$boxesnew[] = $boxes[$i];
$boxes[$i]["used"] = true;