5c7e9ababc0bf454ba08ebc7a41f4a06b339b67e
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);
9 selectMailbox($imapConnection, $orig, $numMessages);
10 getFolderList($imapConnection, $boxesFormatted, $boxesUnformatted);
12 $mailbox = "$subfolder.$new_name";
13 $old_name = substr($orig, strrpos($orig, ".")+
1, strlen($orig));
14 $old_parent = substr($orig, 0, strrpos($orig, "."));
16 for ($i = 0; $i < count($boxesUnformatted); $i++
) {
17 if (substr($boxesUnformatted[$i], 0, strlen($orig)) == $orig) {
18 $after = substr($boxesUnformatted[$i], strlen($orig)+
1, strlen($boxesUnformatted[$i]));
19 selectMailbox($imapConnection, $boxesUnformatted[$i], $numMessages);
20 if (strlen($after) > 0) {
21 createFolder($imapConnection, "$mailbox.$after");
23 $success = copyMessages($imapConnection, 1, $numMessages, "$mailbox.$after");
28 removeFolder($imapConnection, "$boxesUnformatted[$i]");
31 createFolder($imapConnection, "$mailbox");
33 $success = copyMessages($imapConnection, 1, $numMessages, "$mailbox");
38 removeFolder($imapConnection, "$boxesUnformatted[$i]");
43 /** Log out this session **/
44 fputs($imapConnection, "1 logout");
46 echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
47 echo "<BR><BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>Return</A>";
48 echo "</BODY></HTML>";