continue;
}
}
+
if (!$hlt_color)
$hlt_color = $color[4];
- echo " <td width=1% bgcolor=$hlt_color align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."></TD>\n";
+ echo " <td width=1% bgcolor=$hlt_color align=center><input type=checkbox name=\"msg[$t]\" value=".$msg["ID"]."$checked></TD>\n";
echo " <td width=30% bgcolor=$hlt_color>$italic$bold$flag$senderName$flag_end$bold_end$italic_end</td>\n";
echo " <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n";
if ($msg["FLAG_ANSWERED"] == true) echo " <td bgcolor=$hlt_color width=1%><b><small>A</small></b></td>";
$urlMailbox = urlencode($mailbox);
/** This is the beginning of the message list table. It wraps around all messages */
- echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=1>";
+ echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0>";
if ($startMessage < $endMessage) {
echo "<TR BGCOLOR=\"$color[4]\"><TD>";
echo "<TR><TD BGCOLOR=\"$color[0]\">";
echo "\n\n\n<FORM name=messageList method=post action=\"move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$startMessage\">";
- echo "<TABLE BGCOLOR=\"$color[0]\" COLS=2 BORDER=0>\n";
+ echo "<TABLE BGCOLOR=\"$color[0]\" COLS=2 BORDER=0 cellpadding=0 cellspacing=0>\n";
echo " <TR>\n";
echo " <TD WIDTH=60% ALIGN=LEFT>\n";
echo " <NOBR><SMALL>". _("Move selected to:") ."</SMALL>";
echo "<FONT COLOR=\"$color[9]\">Previous</FONT>\n";
echo "<A HREF=\"right_main.php?use_mailbox_cache=1&startMessage=$nextGroup&mailbox=$urlMailbox\" TARGET=\"right\">" . _("Next") . "</A>\n";
}
- echo "</TD></TR></TABLE>"; /** End of message-list table */
-
+ echo "</TD></TR></table>"; /** End of message-list table */
}
?>
/** this function decodes the body depending on the encoding type. **/
function decodeBody($body, $encoding) {
+ $body = str_replace("\r\n", "\n", $body);
$encoding = strtolower($encoding);
if ($encoding == "quoted-printable") {
switch($type0) {
case "text":
$body = decodeBody($body, $header->encoding);
- #header("Content-type: $type0/$type1; name=\"$filename\"");
header("Content-type: application/octet-stream; name=\"$filename\"");
header("Content-Disposition: attachment; filename=\"$filename\"");
+ if ($type1 == "plain") {
+ echo _("Subject") . ": " . decodeHeader(stripslashes($header->subject)) . "\n";
+ echo " " . _("From") . ": " . decodeHeader(stripslashes($header->from)) . "\n";
+ echo " " . _("To") . ": " . decodeHeader(stripslashes(getLineOfAddrs($header->to))) . "\n";
+ echo " " . _("Date") . ": " . getLongDateString($header->date) . "\n\n";
+ }
echo trim($body);
break;
default:
$body = decodeBody($body, $header->encoding);
header("Content-type: application/octet-stream; name=\"$filename\"");
- #header("Content-type: $type0/$type1; name=\"$filename\"");
header("Content-Disposition: attachment; filename=\"$filename\"");
echo $body;
break;
$body = decodeBody ($body, $header->encoding);
header("Content-type: $type0/$type1; name=\"$filename\"");
header("Content-disposition: attachment; filename=\"$filename\"");
+ if ($type0 == "text" && $type1 == "plain") {
+ echo _("Subject") . ": " . decodeHeader(stripslashes($header->subject)) . "\n";
+ echo " " . _("From") . ": " . decodeHeader(stripslashes($header->from)) . "\n";
+ echo " " . _("To") . ": " . decodeHeader(stripslashes(getLineOfAddrs($header->to))) . "\n";
+ echo " " . _("Date") . ": " . getLongDateString($header->date) . "\n\n";
+ }
echo $body;
} else {
switch ($type0) {
echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more\">";
echo ""._("View message") . "</a></b></center></td></tr></table>\n";
echo "<table width=99% cellpadding=2 cellspacing=0 border=0 align=center>\n";
- echo "<tr><td><tt>";
+ echo "<tr><td><pre>";
for ($i=1; $i < count($read)-1; $i++) {
$read[$i] = htmlspecialchars($read[$i]);
if (substr($read[$i], 0, 1) != "\t" &&
substr($read[$i], 0, 1) != "&" &&
trim($read[$i])) {
$pre = substr($read[$i], 0, strpos($read[$i], ":"));
- $read[$i] = str_replace("$pre", "<b>$pre</b>", $read[$i]);
+ $read[$i] = str_replace("$pre", "<b>$pre</b>", decodeHeader($read[$i]));
}
echo "$read[$i]";
}
- echo "</tt></td></tr></table>\n";
+ echo "</pre></td></tr></table>\n";
echo "</body></html>";
exit;
}