summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-08-29 13:01:26 +0000
committeralecpl <alec@alec.pl>2008-08-29 13:01:26 +0000
commitd583bcdfe8523fb6d33c76f86ce77e0cd8d3fe51 (patch)
tree080a890ca6573ab00d2cc732e6eac0aa074b75c2 /program/steps
parent48aff91f7edf261aa45c567f10ee69daea539ae0 (diff)
#1485241: be sure that folder is subscribed when saving sent message
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/sendmail.inc10
1 files 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;