From d583bcdfe8523fb6d33c76f86ce77e0cd8d3fe51 Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 29 Aug 2008 13:01:26 +0000 Subject: #1485241: be sure that folder is subscribed when saving sent message --- program/steps/mail/sendmail.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 301df52e7..a1b25ab43 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -356,14 +356,20 @@ if (!$savedraft) // Determine which folder to save message if ($savedraft) $store_target = $CONFIG['drafts_mbox']; -else +else $store_target = isset($_POST['_store_target']) ? get_input_value('_store_target', RCUBE_INPUT_POST) : $CONFIG['sent_mbox']; if ($store_target) { // check if mailbox exists if (!in_array_nocase($store_target, $IMAP->list_mailboxes())) - $store_folder = $IMAP->create_mailbox($store_target, TRUE); + { + // folder may be existing but not subscribed (#1485241) + if (!in_array_nocase($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; -- cgit v1.2.3