- for ($i = 0; $i < count($boxes); $i++) {
- $use_folder = true;
- if ((strtolower($boxes[$i]['unformatted']) != 'inbox') &&
- ($boxes[$i]['unformatted'] != $trash_folder) &&
- ($boxes[$i]['unformatted'] != $sent_folder) &&
- ($boxes[$i]['unformatted'] != $draft_folder) &&
- (!in_array('noselect', $boxes[$i]['flags'])) &&
- ((strtolower($imap_server_type) != 'courier') ||
- (strtolower($boxes[$i]['unformatted']) != 'inbox.trash'))) {
- $box = $boxes[$i]['unformatted-dm'];
- $box2 = str_replace(' ', ' ',
- imap_utf7_decode_local($boxes[$i]['unformatted-disp']));
- echo " <OPTION VALUE=\"$box\">$box2</option>\n";
- }
- }
- echo "</SELECT></TT>\n";
- echo "<input type=SUBMIT VALUE=\"";
- echo _("Delete");
- echo "\">\n";
- echo "</form></td></tr>\n";
+
+ // send NULL for the flag - ALL folders are eligible for delete (except what we've got in skiplist)
+ // use long format to make sure folder names make sense when parents may be missing.
+ echo sqimap_mailbox_option_list($imapConnection, 0, $skip_folders, $boxes, NULL, true);
+
+ echo "</SELECT></TT>\n"
+ . '<input type=SUBMIT VALUE="'
+ . _("Delete")
+ . "\">\n"
+ . "</form></td></tr>\n";