echo " <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n";
break;
case 4: # subject
- echo " <td bgcolor=$hlt_color>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0$search_stuff\">$flag$subject$flag_end</a>$bold_end</td>\n";
+ echo " <td bgcolor=$hlt_color>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$true_startMessage&show_more=0$search_stuff\">$flag$subject$flag_end</a>$bold_end</td>\n";
break;
case 5: # flags
$stuff = false;
if ($msg["FLAG_ANSWERED"] == true) {
echo "A\n";
$stuff = true;
- }
+ }
if ($msg["TYPE0"] == "multipart") {
echo "+\n";
$stuff = true;
- }
+ }
if (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) {
echo "<font color=$color[1]>!</font>\n";
$stuff = true;
echo "<font color=\"$color[1]\">D</font>\n";
$stuff = true;
}
-
+
if (!$stuff) echo " \n";
echo "</small></b></td>\n";
break;
- case 6: # size
+ case 6: # size
echo " <td bgcolor=$hlt_color width=1%>$bold".show_readable_size($msg['SIZE'])."$bold_end</td>\n";
break;
}
"move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$startMessage",
$mailbox, $sort, $Message, $More);
- // $groupNum = $startMessage % ($show_num - 1);
+ $groupNum = $startMessage % ($show_num - 1);
if ($sort == 6) {
if ($endMessage - $startMessage < $show_num - 1) {
$endMessage = $endMessage - $startMessage + 1;
* $Message is a message that is centered on top of the list
* $More is a second line that is left aligned
*/
- function mail_message_listing_beginning($imapConnection, $moveURL,
+ function mail_message_listing_beginning($imapConnection, $moveURL,
$mailbox = '', $sort = -1, $Message = '', $More = '')
{
global $color, $index_order, $auto_expunge, $move_to_trash;
-
+
/** This is the beginning of the message list table. It wraps around all messages */
echo "<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0>";
-
+
if ($Message)
{
echo "<TR BGCOLOR=\"$color[4]\"><TD align=center>$Message</td></tr>\n";
}
-
+
if ($More)
{
echo "<TR BGCOLOR=\"$color[4]\"><TD>$More</td></tr>\n";
$boxes = sqimap_mailbox_list($imapConnection);
for ($i = 0; $i < count($boxes); $i++) {
- if ($boxes[$i]["flags"][0] != "noselect" &&
- $boxes[$i]["flags"][1] != "noselect" &&
+ if ($boxes[$i]["flags"][0] != "noselect" &&
+ $boxes[$i]["flags"][1] != "noselect" &&
$boxes[$i]["flags"][2] != "noselect") {
$box = $boxes[$i]["unformatted"];
$box2 = replace_spaces($boxes[$i]["formatted"]);
echo "<TR BGCOLOR=\"$color[5]\" ALIGN=\"center\">";
$urlMailbox=urlencode($mailbox);
-
+
// Print the headers
for ($i=1; $i <= count($index_order); $i++) {
switch ($index_order[$i]) {
echo " <A HREF=\"right_main.php?newsort=1&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/up_pointer.gif\" BORDER=0></A></TD>\n";
elseif ($sort == 1)
echo " <A HREF=\"right_main.php?newsort=6&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/down_pointer.gif\" BORDER=0></A></TD>\n";
- elseif ($sort == 6)
+ elseif ($sort == 6)
echo " <A HREF=\"right_main.php?newsort=0&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/sort_none.gif\" BORDER=0></A></TD>\n";
elseif ($sort != -1)
echo " <A HREF=\"right_main.php?newsort=0&startMessage=1&mailbox=$urlMailbox\" TARGET=\"right\"><IMG SRC=\"../images/sort_none.gif\" BORDER=0></A></TD>\n";
$to_list = getLineOfAddrs($to);
$cc_list = getLineOfAddrs($cc);
$bcc_list = getLineOfAddrs($bcc);
-
+
/* Encoding 8-bit characters and making from line */
$subject = sqStripSlashes(encodeHeader($subject));
if ($from == "")
}
sqimap_mailbox_close($imap_stream);
}
-
- if ($useSendmail) {
+
+ // this is to catch all plain \n instances and
+ // replace them with \r\n.
+ $body = ereg_replace("\r\n", "\n", $body);
+ $body = ereg_replace("\n", "\r\n", $body);
+
+ if ($useSendmail) {
$length = sendSendmail($t, $c, $b, $subject, $body, $more_headers);
} else {
$length = sendSMTP($t, $c, $b, $subject, $body, $more_headers);
if (sqimap_mailbox_exists ($imap_stream, $sent_folder)) {
sqimap_append ($imap_stream, $sent_folder, $length);
write822Header ($imap_stream, $t, $c, $b, $subject, $more_headers);
- writeBody ($imap_stream, $body);
+ writeBody ($imap_stream, $body);
sqimap_append_done ($imap_stream);
- }
- sqimap_logout($imap_stream);
+ }
+ sqimap_logout($imap_stream);
// Delete the files uploaded for attaching (if any).
deleteAttachments();
}
-
+
?>
if ($where && $what) {
// Got here from a search
echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."\">";
- } else {
+ } else {
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";
}
if (isset($msgs)) {
- $currentArrayIndex = $passed_id;
+ $currentArrayIndex = $passed_id;
/*
for ($i=0; $i < count($msgs); $i++) {
if ($msgs[$i]["ID"] == $passed_id) {
do_hook("read_body_top");
echo "<BR>";
+
+
+ echo "START: $startMessage<br>";
+
+
echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
echo " <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%>";
echo " <TABLE WIDTH=100% CELLSPACING=0 BORDER=0 COLS=2 CELLPADDING=3>";