X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fleft_main.php;h=61af595db4431b83bec343eed968a74fadd6d8c3;hb=58d11757d242fbdc525c491873e0366ff82b37c1;hp=194eb5b5a3806a44b5cb7915574a1be4cab287aa;hpb=202bcbcc2b67c7c153db1b09b608b62beeba0496;p=squirrelmail.git 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 {