From 429f8906ba14dd45dc3dd2c6d15d74bfcebd6703 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Sat, 24 Jun 2000 04:21:22 +0000 Subject: [PATCH] updated some documentation, fixed minor bugs in MIME decoding, made reply and forward work for composing messages. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@558 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- INSTALL | 11 ++++-- src/compose.php | 88 +++++++++++++------------------------------ src/msg_highlight.php | 17 +++++---- src/read_body.php | 7 ++-- 4 files changed, 46 insertions(+), 77 deletions(-) diff --git a/INSTALL b/INSTALL index f242ce9c..77181a7e 100644 --- a/INSTALL +++ b/INSTALL @@ -84,7 +84,7 @@ d. Running into trouble SquirrelMail is still under development. Therefore you should always get the newest version around. Look at - http://squirrelmail.sourceforge.net/index.php3?page=5 to see what it + http://www.squirrelmail.org/index.php3?page=5 to see what it is. If you want to be bleeding edge you might want to consider using the latest CVS version (with the latest and most fashionable of bugs). @@ -145,9 +145,12 @@ c. Setting up SquirrelMail 4. RUNNING SQUIRRELMAIL ----------------------- - Point your browser at the URL at which SquirrelMail is installed. It - should be pretty stright forward to use. Some more documentation - might show up onbe day or another. + Point your browser at the URL at which SquirrelMail is installed. A + possible example of this is: + http://www.yourdomain.com/squirrelmail + + It should be pretty stright forward to use. Some more documentation + might show up one day or another. 5. RUSSIAN CHARSETS diff --git a/src/compose.php b/src/compose.php index e7c920a3..f3324d62 100644 --- a/src/compose.php +++ b/src/compose.php @@ -36,76 +36,40 @@ $send_to = decodeHeader($send_to); $send_to_cc = decodeHeader($send_to_cc); - if ($forward_id) { - sqimap_mailbox_select($imapConnection, $mailbox); - $msg = sqimap_get_message($imapConnection, $forward_id, $mailbox); - - if (containsType($msg, "text", "html", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]); - } else if (containsType($msg, "text", "plain", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]); - } - // add other primary displaying msg types here - else { - // find any type that's displayable - if (containsType($msg, "text", "any_type", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]); - } else if (containsType($msg, "msg", "any_type", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]); - } else { - $body = _("No Message"); - } - } - - $type1 = $msg["ENTITIES"][$ent_num]["TYPE1"]; - - $tmp = _("-------- Original Message ---------\n"); - $body_ary = explode("\n", $body); - $body = ""; - for ($i=0;$i < count($body_ary);$i++) { - if ($type1 == "html") - $tmp .= strip_tags($body_ary[$i]); - else - $tmp .= $body_ary[$i]; - $body = "$body$tmp\n"; - $tmp = ""; - } - } - - if ($reply_id) { + if ($forward_id) + $id = $forward_id; + else if ($reply_id) + $id = $reply_id; + + if ($id) { sqimap_mailbox_select($imapConnection, $mailbox); - $msg = sqimap_get_message($imapConnection, $reply_id, $mailbox); - - if (containsType($msg, "text", "html", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false); - } else if (containsType($msg, "text", "plain", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false); - } - // add other primary displaying msg types here - else { - // find any type that's displayable - if (containsType($msg, "text", "any_type", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false); - } else if (containsType($msg, "msg", "any_type", $ent_num)) { - $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false); - } else { - $body = _("No Message"); - } + $message = sqimap_get_message($imapConnection, $id, $mailbox); + $message = getEntity($message, $ent_num); + + if ($message->header->type0 == "text" || $message->header->type1 == "message") { + $body = decodeBody(mime_fetch_body($imapConnection, $id, $message->header->entity_id), $message->header->encoding); + } else { + $body = ""; } - $type1 = $msg["ENTITIES"][$ent_num]["TYPE1"]; - + if ($forward_id) + $tmp = _("-------- Original Message ---------\n"); + if ($message->header->type1 == "html") + $body = strip_tags($body); + $body_ary = explode("\n", $body); $body = ""; - for ($i=0;$i < count($body_ary);$i++) { - if ($type1 == "html") - $tmp = strip_tags($body_ary[$i]); + for ($i=0; $i < count($body_ary); $i++) { + $tmp = $body_ary[$i]; + + if ($forward_id) + $body = "$body$tmp\n"; else - $tmp = $body_ary[$i]; - $body = "$body> $tmp\n"; + $body = "$body> $tmp\n"; } + } - + if (!$send_to) { $send_to = sqimap_find_email($send_to); } diff --git a/src/msg_highlight.php b/src/msg_highlight.php index 7fbca45b..dc35e485 100644 --- a/src/msg_highlight.php +++ b/src/msg_highlight.php @@ -88,19 +88,19 @@ echo "\n"; echo "\n"; echo " \n"; - echo " \n"; - echo " \n"; echo " \n"; echo " \n"; echo " \n"; - echo " \n"; - echo " \n"; echo " \n"; echo " \n"; - echo " \n"; - echo " \n"; + echo "  ("; + echo _("Regular Expression"); + echo ")\n \n"; echo " \n"; echo "
\n"; + echo " \n"; echo _("Identifying name") . ":"; echo " \n"; + echo " \n"; echo " "; echo "


\n"; + echo " \n"; echo _("Color") . ":"; echo " \n"; + echo " \n"; echo "  


\n"; + echo " \n"; echo _("Match") . ":"; echo " \n"; + echo " \n"; echo " \n"; - echo " "; - echo "
\n"; echo "
\n"; diff --git a/src/read_body.php b/src/read_body.php index e6e4e108..5b984338 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -83,6 +83,7 @@ $url_replytoallcc = urlencode(getLineOfAddrs($message->header->to) . ", " . getLineOfAddrs($message->header->cc)); $dateString = getLongDateString($message->header->date); + $ent_num = findDisplayEntity($message); /** TEXT STRINGS DEFINITIONS **/ $echo_more = _("more"); @@ -174,13 +175,13 @@ echo " \n"; echo " "; echo " "; - echo " "; + echo " "; echo _("Forward"); echo " | "; - echo " "; + echo " "; echo _("Reply"); echo " | "; - echo " "; + echo " "; echo _("Reply All"); echo "  "; echo " "; -- 2.25.1