Added limited support for Cyrillic (only KOI8-R yet) and made it possible to
[squirrelmail.git] / functions / imap_mailbox.php
index 143edfdc9bf2bcd2a7ce24583bcce96c89070bdb..0673787642140e02e92bcbf1739f6b71e2d3a205 100755 (executable)
 
    
    /******************************************************************************
-    **  This is a recursive function that checks to see if the folder has any 
-    **  subfolders, and if so it calls itself on the subfolders first, then 
-    **  removes the parent folder.
+    **  This function simply deletes the given folder
     ******************************************************************************/
    function sqimap_mailbox_delete ($imap_stream, $mailbox) {
-      global $boxes;
-
-      $dm = sqimap_get_delimiter($imap_stream);
-      for ($i = 0; $i < count($boxes); $i++) {
-         if (strstr($boxes[$i]["unformatted"], $mailbox . $dm)) {
-            $new_delete = $boxes[$i]["unformatted"];
-            $boxes = removeElement($boxes, $i);
-//            sqimap_mailbox_delete ($imap_stream, $new_delete);
-         }
-      }
-      sqimap_unsubscribe ($imap_stream, $mailbox);
       fputs ($imap_stream, "a001 DELETE \"$mailbox\"\n");
+      echo "mailbox: $mailbox<BR>";
       $read_ary = sqimap_read_data($imap_stream, "a001", true, $response, $message);
+      sqimap_unsubscribe ($imap_stream, $mailbox);
    }
 
 
                $boxes[$g]["formatted"] = $boxes[$g]["formatted"] . "  ";
             $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
                
+            $boxes[$g]["unformatted-dm"] = $mailbox;
             if (substr($mailbox, -1) == $dm)
                $mailbox = substr($mailbox, 0, strlen($mailbox) - 1);
             $boxes[$g]["unformatted"] = $mailbox;