2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/imap.php");
6 include("../functions/mailbox.php");
8 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
10 // switch to the mailbox, and get the number of messages in it.
13 selectMailbox($imapConnection, $mailbox, $numMessages);
15 $folder = getFolderNameMinusINBOX($mailbox);
16 $trash = getFolderNameMinusINBOX($trash_folder);
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.$trash.$folder");
21 echo "CREATING FOLDER: user.$username.$trash.$folder<BR>";
23 $success = copyMessages($imapConnection, 1, $numMessages, $trash_folder);
28 removeFolder($imapConnection, "user.$username.$folder");
30 removeFolder($imapConnection, "user.$username.$folder");
34 // Log out this session
35 fputs($imapConnection, "1 logout");
37 echo "<BR><BR><A HREF=\"folders.php\">Return</A>";