From 8ae331c2a15d4e0c10bebd806fd2c5a2c10cf67f Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 16 Nov 2000 14:16:53 +0000 Subject: [PATCH] made sorting a bit faster replaced \n with \r\n in body of message before sending git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@847 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + functions/mailbox_display.php | 28 ++++++++++++++-------------- functions/smtp.php | 19 ++++++++++++------- src/read_body.php | 9 +++++++-- 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index d300d276..0473e70b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Version 1.0pre1 -- DEVELOPMENT ------------------------------ +- Now replacing all \n with \r\n before sending the message. - Added sorting option for NO sorting.. 10000 times faster! - Using
 tags for viewing message body instead of  and  
 - Added redirection from subdirectories to login page
diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php
index 4fe113dc..ef25fba5 100644
--- a/functions/mailbox_display.php
+++ b/functions/mailbox_display.php
@@ -63,7 +63,7 @@
                echo "   
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; break; case 4: # subject - echo " $bold$flag$subject$flag_end$bold_end\n"; + echo " $bold$flag$subject$flag_end$bold_end\n"; break; case 5: # flags $stuff = false; @@ -71,11 +71,11 @@ 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 "!\n"; $stuff = true; @@ -84,11 +84,11 @@ echo "D\n"; $stuff = true; } - + if (!$stuff) echo " \n"; echo "\n"; break; - case 6: # size + case 6: # size echo " $bold".show_readable_size($msg['SIZE'])."$bold_end\n"; break; } @@ -336,7 +336,7 @@ "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; @@ -405,19 +405,19 @@ * $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 ""; - + if ($Message) { echo "\n"; } - + if ($More) { echo "\n"; @@ -435,8 +435,8 @@ $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"]); @@ -463,7 +463,7 @@ echo ""; $urlMailbox=urlencode($mailbox); - + // Print the headers for ($i=1; $i <= count($index_order); $i++) { switch ($index_order[$i]) { @@ -492,7 +492,7 @@ echo " \n"; elseif ($sort == 1) echo " \n"; - elseif ($sort == 6) + elseif ($sort == 6) echo " \n"; elseif ($sort != -1) echo " \n"; diff --git a/functions/smtp.php b/functions/smtp.php index ad7a257a..9546fe76 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -142,7 +142,7 @@ $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 == "") @@ -503,8 +503,13 @@ } 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); @@ -513,12 +518,12 @@ 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(); } - + ?> diff --git a/src/read_body.php b/src/read_body.php index 3aa9bdb4..e3079f17 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -40,7 +40,7 @@ if ($where && $what) { // Got here from a search echo ""; - } else { + } else { echo ""; } echo ""._("View message") . "
$Message
$More
\n"; @@ -96,7 +96,7 @@ } if (isset($msgs)) { - $currentArrayIndex = $passed_id; + $currentArrayIndex = $passed_id; /* for ($i=0; $i < count($msgs); $i++) { if ($msgs[$i]["ID"] == $passed_id) { @@ -221,6 +221,11 @@ do_hook("read_body_top"); echo "
"; + + + echo "START: $startMessage
"; + + echo "\n"; echo "
"; echo " "; -- 2.25.1