Bug #8520: Make sure sent mail folder exists if using drop-down selection on compose...
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Nov 2009 18:52:27 +0000 (11:52 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Nov 2009 19:03:06 +0000 (12:03 -0700)
imp/compose.php
imp/docs/CHANGES
imp/lib/Views/Compose.php

index 8570ca1..8e7cc96 100644 (file)
@@ -1101,6 +1101,14 @@ if ($redirect) {
                 'selected' => $sent_mail_folder
             );
             $t->set('ssm_tabindex', ++$tabindex);
+
+            /* Check to make sure the sent-mail folder is created - it needs
+             * to exist to show up in drop-down list. */
+            $imp_folder = IMP_Folder::singleton();
+            if (!$imp_folder->exists($sent_mail_folder)) {
+                $imp_folder->create($sent_mail_folder, true);
+            }
+
             $t->set('ssm_folders', IMP::flistSelect($ssm_folder_options));
         } else {
             if (!empty($sent_mail_folder)) {
index 568b209..93b5a31 100644 (file)
@@ -116,6 +116,8 @@ v5.0-git
 v4.3.6-cvs
 ----------
 
+[mms] Make sure sent-mail folders exist if using the drop-down selection list
+      on the compose page (Bug #8520).
 [mms] When replying to list, correctly extract e-mail address if multiple
       entries exist in the List-Post header (Bug #8719).
 [mms] For messages marked as innocent but not moved to Inbox, don't report
index 478a3ea..e64f350 100644 (file)
@@ -95,6 +95,15 @@ class IMP_Views_Compose
         if (!empty($GLOBALS['conf']['user']['select_sentmail_folder']) &&
             !$GLOBALS['prefs']->isLocked('sent_mail_folder')) {
             $imp_folder = IMP_Folder::singleton();
+
+            /* Check to make sure the sent-mail folders are created - they
+             * need to exist to show up in drop-down list. */
+            foreach ($identities as $val) {
+                if (!$imp_folder->exists($val[3])) {
+                    $imp_folder->create($val[3], true);
+                }
+            }
+
             $flist = array();
             foreach ($imp_folder->flist() as $val) {
                 $tmp = array('l' => $val['abbrev'], 'v' => $val['val']);