2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/imap.php");
7 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
9 // switch to the mailbox, and get the number of messages in it.
10 selectMailbox($imapConnection, $mailbox, $numMessages);
12 // Marks the selected messages ad 'Deleted'
16 while ($j < count($msg)) {
18 /** check if they would like to move it to the trash folder or not */
19 if ($move_to_trash == true) {
20 createFolder($imapConnection, "user.$username.$folder");
21 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
23 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
25 setMessageFlag($imapConnection, $msg[$i], "Deleted");
32 if ($auto_expunge == true)
33 expungeBox($imapConnection, $mailbox, $numMessages);
35 // Log out this session
36 fputs($imapConnection, "1 logout");
38 echo "<BR><BR><A HREF=\"folders.php\">Return</A>";