include("../config/config.php"); include("../functions/strings.php"); include("../functions/page_header.php"); include("../functions/imap.php"); include("../src/load_prefs.php"); $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0); $dm = sqimap_get_delimiter($imapConnection); if (strpos($orig, $dm)) $old_dir = substr($orig, 0, strrpos($orig, $dm)); else $old_dir = ""; if ($old_dir != "") $newone = "$old_dir$dm$new_name"; else $newone = "$new_name"; fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\n"); $data = sqimap_read_data($imapConnection, ".", true, $a, $b); // Renaming a folder doesn't renames the folder but leaves you unsubscribed // at least on Cyrus IMAP servers. fputs ($imapConnection, "sub UNSUBSCRIBE \"$orig\"\n"); fputs ($imapConnection, "sub SUBSCRIBE \"$newone\"\n"); $data = sqimap_read_data($imapConnection, "sub", true, $a, $b); /** Log out this session **/ fputs($imapConnection, "1 logout"); echo "
\n"; echo "