mailbox caching breaks automatic folder creation, if folder exists and is
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 23 Apr 2006 14:18:27 +0000 (14:18 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 23 Apr 2006 14:18:27 +0000 (14:18 +0000)
not subscribed.

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

src/left_main.php

index 194eb5b5a3806a44b5cb7915574a1be4cab287aa..61af595db4431b83bec343eed968a74fadd6d8c3 100644 (file)
@@ -73,8 +73,18 @@ if ($auto_create_special && !isset($auto_create_done)) {
     $folders_created = false;
     foreach( $autocreate as $folder ) {
         if (($folder != '') && ($folder != 'none')) {
-            // use $mailboxes array for checking if mailbox exists
-            if ( !sqimap_mailbox_exists($imapConnection, $folder, $mailboxes)) {
+            /**
+             * If $show_only_subscribed_folders is true, don't use 
+             * $mailboxes array for checking if mailbox exists.
+             * Mailbox list contains only subscribed folders. 
+             * sqimap_mailbox_create() will fail, if folder exists.
+             */
+            if ($show_only_subscribed_folders) {
+                $mailbox_cache = false;
+            } else {
+                $mailbox_cache = $mailboxes;
+            }
+            if ( !sqimap_mailbox_exists($imapConnection, $folder, $mailbox_cache)) {
                 sqimap_mailbox_create($imapConnection, $folder, '');
                 $folders_created = true;
             } else {