From d388a95803ea41fe541ebc2bff6e78194c1f872d Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 23 Apr 2006 14:18:27 +0000 Subject: [PATCH] mailbox caching breaks automatic folder creation, if folder exists and is 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 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/left_main.php b/src/left_main.php index 194eb5b5..61af595d 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -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 { -- 2.25.1