sqimap_mailbox_select ($imap_stream, $mailbox);
fputs ($imap_stream, "a001 EXPUNGE\r\n");
$read = sqimap_read_data($imap_stream, "a001", true, $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
******************************************************************************/
- function sqimap_mailbox_select ($imap_stream, $mailbox, $hide=true) {
+ function sqimap_mailbox_select ($imap_stream, $mailbox, $hide=true, $recent=false) {
fputs ($imap_stream, "a001 SELECT \"$mailbox\"\r\n");
$read = sqimap_read_data($imap_stream, "a001", true, $response, $message);
+ if ($recent) {
+ for ($i=0; $i<count($read); $i++) {
+ if (strpos(strtolower($read[$i]), "recent")) {
+ $r = explode(" ", $read[$i]);
+ }
+ }
+ return $r[1];
+ }
}
$dm_count--;
for ($j = 0; $j < $dm_count - (countCharInString($folder_prefix, $dm)); $j++)
- $boxes[$g]["formatted"] = $boxes[$g]["formatted"] . " ";
+ $boxes[$g]["formatted"] = $boxes[$g]["formatted"] . " ";
$boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
$boxes[$g]["unformatted-dm"] = $mailbox;