+ /** Next, we get all subscribed folders **/
+ fputs($imapConnection, "1 LSUB \"\" *\n");
+ $str = imapReadData($imapConnection, "1", true, $response, $message);
+ $dm = findMailboxDelimeter($imapConnection);
+ for ($i = 0;$i < count($str); $i++) {
+ $mailbox = chop($str[$i]);
+ if (substr(findMailboxName($mailbox), 0, 1) != ".") {
+ $boxes[$g]["RAW"] = $mailbox;
+
+ $mailbox = findMailboxName($mailbox);
+ $periodCount = countCharInString($mailbox, $dm);
+
+ // indent the correct number of spaces.
+ for ($j = 0;$j < $periodCount;$j++)
+ $boxes[$g]["FORMATTED"] = $boxes[$g]["FORMATTED"] . " ";
+
+ $boxes[$g]["FORMATTED"] = $boxes[$g]["FORMATTED"] . readShortMailboxName($mailbox, $dm);
+ $boxes[$g]["UNFORMATTED"] = $mailbox;
+ $boxes[$g]["ID"] = $g;
+ $g++;
+ }
+ }
+