1 <HTML
><BODY TEXT
="#000000" BGCOLOR
="#FFFFFF" LINK
="#0000EE" VLINK
="#0000EE" ALINK
="#0000EE">
3 include("../config/config.php");
4 include("../functions/mailbox.php");
5 include("../functions/strings.php");
6 include("../functions/page_header.php");
7 include("../functions/display_messages.php");
8 include("../functions/imap.php");
10 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
12 // switch to the mailbox, and get the number of messages in it.
13 selectMailbox($imapConnection, $mailbox, $numMessages, $imapServerAddress);
15 if (strtolower($move_or_delete) == "delete selected messages") {
16 // Marks the selected messages ad 'Deleted'
20 // If they have selected nothing msg is size one still, but will be an infinite
21 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
22 while (($j < count($msg)) && ($msg[0])) {
24 /** check if they would like to move it to the trash folder or not */
25 if ($move_to_trash == true) {
26 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
28 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
30 setMessageFlag($imapConnection, $msg[$i], "Deleted");
36 if ($auto_expunge == true)
37 expungeBox($imapConnection, $mailbox, $numMessages);
38 displayPageHeader($mailbox);
39 messages_deleted_message($mailbox, $sort, $startMessage);
44 // If they have selected nothing msg is size one still, but will be an infinite
45 // loop because we never increment j. so check to see if msg[0] is set or not to fix this.
46 while (($j < count($msg)) && ($msg[0])) {
48 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
49 if ($success == true) {
50 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
51 displayPageHeader($mailbox);
53 if ($auto_expunge == true)
54 expungeBox($imapConnection, $mailbox, $numMessages);
61 // Log out this session
62 fputs($imapConnection, "1 logout");