include("../config/config.php"); include("../functions/strings.php"); include("../functions/page_header.php"); include("../functions/imap.php"); include("../functions/mailbox.php"); displayPageHeader("None"); echo "
\n"; echo "
\n"; echo "
Folders
\n"; echo "
\n"; echo "
\n"; $imapConnection = loginToImapServer($username, $key, $imapServerAddress); fputs($imapConnection, "1 list \"\" *\n"); $str = imapReadData($imapConnection); for ($i = 0;$i < count($str); $i++) { $mailbox = Chop($str[$i]); // find the quote at the begining of the mailbox name. // i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name. $mailbox = findMailboxName($mailbox); $periodCount = countCharInString($mailbox, "."); // indent the correct number of spaces. for ($j = 0;$j < $periodCount;$j++) $boxes[$i] = "$boxes[$i] "; $boxes[$i] = $boxes[$i] . readShortMailboxName($mailbox, "."); $long_name_boxes[$i] = $mailbox; } /** DELETING FOLDERS **/ echo "
\n"; echo "
\n"; for ($i = 0; $i < count($str); $i++) { $thisbox = Chop($str[$i]); $thisbox = findMailboxName($thisbox); $thisbox = getFolderNameMinuxINBOX($thisbox); $use_folder = true; for ($p = 0; $p < count($special_folders); $p++) { if ($special_folders[$p] == $long_name_boxes[$i]) $use_folder = false; } if ($use_folder == true) echo "
$thisbox\n"; } echo "
\n"; echo "
\n"; echo "
\n"; /** CREATING FOLDERS **/ echo "
\n"; echo "
\n"; echo " as a subfolder of "; echo "
\n"; for ($i = 0;$i < count($str); $i++) { $thisbox = Chop($str[$i]); $thisbox = findMailboxName($thisbox); $thisbox = getFolderNameMinusINBOX($thisbox); echo "
$thisbox\n"; } echo "
\n"; echo "
\n"; echo "
\n"; /** RENAMING FOLDERS **/ echo "
\n"; echo "
\n"; for ($i = 0; $i < count($str); $i++) { $use_folder = true; for ($p = 0; $p < count($special_folders); $p++) { if ($special_folders[$p] == $long_name_boxes[$i]) $use_folder = false; } if ($use_folder == true) echo "
$boxes[$i]\n"; } echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; ?>