Remove check for INBOX. If inbox isn't in the LSUB response then it's
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 10 Jul 2003 20:20:05 +0000 (20:20 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 10 Jul 2003 20:20:05 +0000 (20:20 +0000)
unsubscribed and we just add it to the list. No reason to check specificly
for LSUB "" "INBOX" or LIST "" "INBOX"
If there is no inbox then a select will produce an error message.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5260 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php

index d623e1483106c0a837f5b97307f2b785fa061a7b..3289cad035f20b2bb4bc784cbd6436ae3a0898f1 100755 (executable)
@@ -737,17 +737,7 @@ function sqimap_mailbox_tree($imap_stream) {
         }
 
         if ($has_inbox == false) {
-            $lsub_ibx = sqimap_run_command( $imap_stream, "LSUB \"\" \"INBOX\"", true, $response, $message );
-            if (isset($lsub_ibx[0]) && (preg_match("/^\*\s+LSUB\s+(.*)\"?INBOX\"?[^(\/\.)].*$/",$lsub_ibx[0]))) {
-                $lsub_ary[] = $lsub_ibx[0];
-            } else {
-                $lsub_ibx = sqimap_run_command( $imap_stream, "LIST \"\" \"INBOX\"", true, $response, $message );
-                if (preg_match("/^\*\s+LIST\s+(.*)\"?INBOX\"?[^(\/\.)].*$/",$lsub_ibx[0])) {
-                    sqimap_run_command( $imap_stream, "SUBSCRIBE \"INBOX\"", true, $response, $message );
-                    $lsub_ibx[0] = str_replace("LIST","LSUB",$lsub_ibx[0]);
-                    $lsub_ary[] = $lsub_ibx[0];
-                }
-            }
+           $lsub_ary[] = '* LSUB () INBOX';
         }
 
         /*