b40316f9 |
1 | <? |
2 | include("../config/config.php"); |
3 | include("../functions/strings.php"); |
4 | include("../functions/page_header.php"); |
5 | include("../functions/imap.php"); |
597d8f1d |
6 | include("../functions/mailbox.php"); |
b40316f9 |
7 | |
2aa12d5e |
8 | $imapConnection = loginToImapServer($username, $key, $imapServerAddress); |
8c7dfc99 |
9 | |
10 | // switch to the mailbox, and get the number of messages in it. |
11 | selectMailbox($imapConnection, $mailbox, $numMessages); |
12 | |
597d8f1d |
13 | $folder = getFolderNameMinusINBOX($mailbox); |
14 | $trash = getFolderNameMinusINBOX($trash_folder); |
15 | |
16 | /** check if they would like to move it to the trash folder or not */ |
17 | if ($move_to_trash == true) { |
18 | createFolder($imapConnection, "user.$username.$trash.$folder"); |
19 | echo "CREATING FOLDER: user.$username.$trash.$folder<BR>"; |
20 | if ($numMessages > 0) |
21 | $success = copyMessages($imapConnection, 1, $numMessages, $trash_folder); |
22 | else |
23 | $success = true; |
24 | |
25 | if ($success == true) |
26 | removeFolder($imapConnection, "user.$username.$folder"); |
27 | } else { |
28 | removeFolder($imapConnection, "user.$username.$folder"); |
8c7dfc99 |
29 | } |
b40316f9 |
30 | |
8c7dfc99 |
31 | // Log out this session |
32 | fputs($imapConnection, "1 logout"); |
b40316f9 |
33 | |
34 | echo "<BR><BR><A HREF=\"folders.php\">Return</A>"; |
35 | ?> |
36 | |
37 | |