updated some documentation, fixed minor bugs in MIME decoding, made
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 24 Jun 2000 04:21:22 +0000 (04:21 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 24 Jun 2000 04:21:22 +0000 (04:21 +0000)
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
src/compose.php
src/msg_highlight.php
src/read_body.php

diff --git a/INSTALL b/INSTALL
index f242ce9..77181a7 100644 (file)
--- 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
 
   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).
   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
 -----------------------
 
 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
 
 
 5. RUSSIAN CHARSETS
index e7c920a..f3324d6 100644 (file)
       $send_to = decodeHeader($send_to);
       $send_to_cc = decodeHeader($send_to_cc);
 
       $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);
          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 = "";
          $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
             else
-               $tmp = $body_ary[$i];
-            $body = "$body> $tmp\n";
+               $body = "$body> $tmp\n";
          }
          }
+            
       }
       }
-      
+
       if (!$send_to) {
          $send_to = sqimap_find_email($send_to);
       }
       if (!$send_to) {
          $send_to = sqimap_find_email($send_to);
       }
index 7fbca45..dc35e48 100644 (file)
       echo "<input type=\"hidden\" value=\"$id\" name=\"id\">\n";
       echo "<table width=80% align=center cellpadding=2 cellspacing=0 border=0>\n";
       echo "   <tr>\n";
       echo "<input type=\"hidden\" value=\"$id\" name=\"id\">\n";
       echo "<table width=80% align=center cellpadding=2 cellspacing=0 border=0>\n";
       echo "   <tr>\n";
-      echo "      <td align=right width=40%>\n";
+      echo "      <td align=right width=25%>\n";
       echo _("Identifying name") . ":";
       echo "      </td>\n";
       echo _("Identifying name") . ":";
       echo "      </td>\n";
-      echo "      <td width=60%>\n";
+      echo "      <td width=75%>\n";
       echo "         <input type=\"text\" value=\"".$message_highlight_list[$id]["name"]."\" name=\"name\">";
       echo "      </td>\n";
       echo "   </tr>\n";
       echo "   <tr><td><br><br></td></tr>\n";
       echo "   <tr>\n";
       echo "         <input type=\"text\" value=\"".$message_highlight_list[$id]["name"]."\" name=\"name\">";
       echo "      </td>\n";
       echo "   </tr>\n";
       echo "   <tr><td><br><br></td></tr>\n";
       echo "   <tr>\n";
-      echo "      <td align=right width=40%>\n";
+      echo "      <td align=right width=25%>\n";
       echo _("Color") . ":";
       echo "      </td>\n";
       echo _("Color") . ":";
       echo "      </td>\n";
-      echo "      <td width=60%>\n";
+      echo "      <td width=75%>\n";
       echo "         <input type=\"radio\" name=color_type value=1$selected_choose> &nbsp;<select name=newcolor_choose>\n";
       echo "            <option value=\"$color_list[0]\"$selected0>" . _("Dark Blue") . "\n";
       echo "            <option value=\"$color_list[1]\"$selected1>" . _("Dark Green") . "\n";
       echo "         <input type=\"radio\" name=color_type value=1$selected_choose> &nbsp;<select name=newcolor_choose>\n";
       echo "            <option value=\"$color_list[0]\"$selected0>" . _("Dark Blue") . "\n";
       echo "            <option value=\"$color_list[1]\"$selected1>" . _("Dark Green") . "\n";
       echo "   </tr>\n";
       echo "   <tr><td><br><br></td></tr>\n";
       echo "   <tr>\n";
       echo "   </tr>\n";
       echo "   <tr><td><br><br></td></tr>\n";
       echo "   <tr>\n";
-      echo "      <td align=right width=40%>\n";
+      echo "      <td align=right width=25%>\n";
       echo _("Match") . ":";
       echo "      </td>\n";
       echo _("Match") . ":";
       echo "      </td>\n";
-      echo "      <td width=60%>\n";
+      echo "      <td width=75%>\n";
       echo "         <select name=match_type>\n";
       if ($message_highlight_list[$id]["match_type"] == "from")    echo "            <option value=\"from\" selected>From\n"; 
       else                                                         echo "            <option value=\"from\">From\n"; 
       echo "         <select name=match_type>\n";
       if ($message_highlight_list[$id]["match_type"] == "from")    echo "            <option value=\"from\" selected>From\n"; 
       else                                                         echo "            <option value=\"from\">From\n"; 
       if ($message_highlight_list[$id]["match_type"] == "subject") echo "            <option value=\"subject\" selected>Subject\n"; 
       else                                                         echo "            <option value=\"subject\">Subject\n"; 
       echo "         </select>\n";
       if ($message_highlight_list[$id]["match_type"] == "subject") echo "            <option value=\"subject\" selected>Subject\n"; 
       else                                                         echo "            <option value=\"subject\">Subject\n"; 
       echo "         </select>\n";
-      echo "         <input type=\"text\" value=\"".$message_highlight_list[$id]["value"]."\" name=\"value\">";
-      echo "      </td>\n";
+      echo "         <nobr><input type=\"text\" value=\"".$message_highlight_list[$id]["value"]."\" name=\"value\"> &nbsp;(";
+      echo _("Regular Expression");
+      echo ")\n      <nobr></td>\n";
       echo "   </tr>\n";
       echo "</table>\n";
       echo "<center><input type=\"submit\" value=\"" . _("Submit") . "\"></center>\n";
       echo "   </tr>\n";
       echo "</table>\n";
       echo "<center><input type=\"submit\" value=\"" . _("Submit") . "\"></center>\n";
index e6e4e10..5b98433 100644 (file)
@@ -83,6 +83,7 @@
    $url_replytoallcc = urlencode(getLineOfAddrs($message->header->to) . ", " . getLineOfAddrs($message->header->cc));
 
    $dateString = getLongDateString($message->header->date);
    $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");
 
    /** TEXT STRINGS DEFINITIONS **/
    $echo_more = _("more");
    echo "               </SMALL>\n";
    echo "            </TD><TD WIDTH=33% ALIGN=RIGHT>";
    echo "               <SMALL>";
    echo "               </SMALL>\n";
    echo "            </TD><TD WIDTH=33% ALIGN=RIGHT>";
    echo "               <SMALL>";
-   echo "               <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox\">";
+   echo "               <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox&ent_num=$ent_num\">";
    echo _("Forward");
    echo "</A>&nbsp;|&nbsp;";
    echo _("Forward");
    echo "</A>&nbsp;|&nbsp;";
-   echo "               <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
+   echo "               <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\">";
    echo _("Reply");
    echo "</A>&nbsp;|&nbsp;";
    echo _("Reply");
    echo "</A>&nbsp;|&nbsp;";
-   echo "               <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
+   echo "               <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\">";
    echo _("Reply All");
    echo "</A>&nbsp;&nbsp;";
    echo "               </SMALL>";
    echo _("Reply All");
    echo "</A>&nbsp;&nbsp;";
    echo "               </SMALL>";