+ "<TR><TD BGCOLOR=\"$color[4]\"><TT><BR>";
+ echo "$body </TT></TD></TR><table><br>";
+ echo '<table width="100%"><tr>'.
+ "<td bgcolor=\"$color[9]\" width=\"100%\" align=\"center\">".
+ '<form action="download.php" method="post"><small>'.
+ "<input type=\"hidden\" name=\"passed_id\" value=\"$id\">".
+ "<input type=\"hidden\" name=\"mailbox\" value=\"".$mailbox."\">".
+ "<input type=\"hidden\" name=\"startMessage\" value=\"$startMessage\">".
+ "<input type=\"hidden\" name=\"passed_ent_id\" value=\"$ent_id\">".
+ "<input type=\"hidden\" name=\"extract_message\" value=\"1\">".
+ _("Save to:") .
+ ' <select name="targetMailbox">';
+ get_extract_to_target_list($imapConnection);
+ echo '</select> '.' '.
+ '<input type="submit" value="' . _("Extract") . '">'.
+ '</small>'.
+ '</form>'.
+ '</td></table>';
+
+}
+
+function get_extract_to_target_list($imapConnection) {
+
+ $boxes = sqimap_mailbox_list($imapConnection);
+ for ($i = 0; $i < count($boxes); $i++) {
+ if (!in_array('noselect', $boxes[$i]['flags'])) {
+ $box = $boxes[$i]['unformatted'];
+ $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']);
+ if ( $box2 == 'INBOX' ) {
+ $box2 = _("INBOX");
+ }
+ echo "<option value=\"$box\">$box2</option>\n";
+ }
+ }