summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail')
-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;