summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc19
1 files changed, 8 insertions, 11 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index e9d215003..aed7af9ac 100644
--- a/program/steps/mail/sendmail.inc
+++ b/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) {