+ /** LIST array **/
+ $sorted_list_ary = array();
+ for ($i=0; $i < count($sorted_lsub_ary); $i++) {
+ if (substr($sorted_lsub_ary[$i], -1) == $dm)
+ $mbx = substr($sorted_lsub_ary[$i], 0, strlen($sorted_lsub_ary[$i])-1);
+ else
+ $mbx = $sorted_lsub_ary[$i];
+
+ fputs ($imap_stream, "a001 LIST \"\" \"$mbx\"\r\n");
+ $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
+ // Another workaround for EIMS
+ if (isset($read[1]) &&
+ ereg("^(\\* [A-Z]+.*)\\{[0-9]+\\}([ \n\r\t]*)$",
+ $read[0], $regs)) {
+ $read[0] = $regs[1] . '"' . addslashes(trim($read[1])) .
+ '"' . $regs[2];
+ }
+ if (isset($sorted_list_ary[$i]))
+ $sorted_list_ary[$i] = "";
+ if (isset($read[0]))
+ $sorted_list_ary[$i] = $read[0];
+ else
+ $sorted_list_ary[$i] = "";
+ if (isset($sorted_list_ary[$i]) &&
+ strtoupper(find_mailbox_name($sorted_list_ary[$i])) == "INBOX")
+ $inbox_in_list = true;
+ }
+
+ /** Just in case they're not subscribed to their inbox, we'll get it
+ for them anyway **/