summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-03 06:41:57 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-03 06:41:57 +0000
commite5e1b88cd41ae9ff9979a659e9dc861232a0b155 (patch)
tree0b60240d4e4df1680317e2a82f27332d252d3095 /roundcubemail/program/steps
parent5545618783071011a6a8eb7afe1bb1f4e2902927 (diff)
- preformance fix: don't load full folders list when checking for folder
existance in sendmail.inc, use internal cache to make mailbox_exists() faster when called more than one time for the same folder git-svn-id: https://svn.roundcube.net/trunk@3586 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/mail/sendmail.inc19
1 files changed, 8 insertions, 11 deletions
diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc
index e9d215003..aed7af9ac 100644
--- a/roundcubemail/program/steps/mail/sendmail.inc
+++ b/roundcubemail/program/steps/mail/sendmail.inc
@@ -566,17 +566,14 @@ else
if ($store_target)
{
- // check if mailbox exists
- if (!in_array($store_target, $IMAP->list_mailboxes()))
- {
- // folder may be existing but not subscribed (#1485241)
- if (!in_array($store_target, $IMAP->list_unsubscribed()))
- $store_folder = $IMAP->create_mailbox($store_target, TRUE);
- else if ($IMAP->subscribe($store_target))
- $store_folder = TRUE;
- }
- else
- $store_folder = TRUE;
+ // check if folder is subscribed
+ if ($IMAP->mailbox_exists($store_target, true))
+ $store_folder = true;
+ // folder may be existing but not subscribed (#1485241)
+ else if (!$IMAP->mailbox_exists($store_target))
+ $store_folder = $IMAP->create_mailbox($store_target, true);
+ else if ($IMAP->subscribe($store_target))
+ $store_folder = true;
// append message to sent box
if ($store_folder) {