3af351a89ae6178fb72dc38689293af5dce9d1d3
2 include("../config/config.php");
3 include("../functions/strings.php");
4 include("../functions/page_header.php");
5 include("../functions/imap.php");
7 $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString);
8 if (!$imapConnection) {
9 echo "Error connecting to IMAP Server.<br>";
10 echo "$errorNumber : $errorString<br>";
13 $serverInfo = fgets($imapConnection, 256);
15 fputs($imapConnection, "1 login $username $key\n");
16 $read = fgets($imapConnection, 1024);
19 if (strpos($read, "NO")) {
20 error_username_password_incorrect();
24 // switch to the mailbox, and get the number of messages in it.
25 selectMailbox($imapConnection, $mailbox, $numMessages);
27 // Marks the selected messages ad 'Deleted'
31 while ($j < count($msg)) {
33 /** check if they would like to move it to the trash folder or not */
34 if ($move_to_trash == true) {
35 createFolder($imapConnection, "user.$username.$folder");
36 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
38 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
40 setMessageFlag($imapConnection, $msg[$i], "Deleted");
47 if ($auto_expunge == true)
48 expungeBox($imapConnection, $mailbox, $numMessages);
50 // Log out this session
51 fputs($imapConnection, "1 logout");
53 echo "<BR><BR><A HREF=\"folders.php\">Return</A>";