Modified to return bcc header if available, for save as draft.
authorfallas <fallas@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 29 Oct 2001 14:48:02 +0000 (14:48 +0000)
committerfallas <fallas@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 29 Oct 2001 14:48:02 +0000 (14:48 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1648 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
src/read_body.php

index 4cef81eb67270c6d481b225aee68c9f3c3858b46..a3b81d98c489279feb163a7f5b44c5170799829f 100755 (executable)
                $i++;
             }
          }
+         /** BCC **/
+         else if (strtolower(substr($read[$i], 0, 4)) == "bcc:") {
+            $pos = 0;
+            $hdr->bcc[$pos] = trim(substr($read[$i], 5));
+            $i++;
+            while (((substr($read[$i], 0, 1) == " ") || (substr($read[$i], 0, 1) == "\t"))  && (trim($read[$i]) != "")){
+               $pos++;
+               $hdr->bcc[$pos] = trim($read[$i]);
+               $i++;
+            }
+         }
          /** TO **/
          else if (strtolower(substr($read[$i], 0, 3)) == "to:") {
             $pos = 0;
index a47817b16e5d4456ae294f6c30571deb2300a78a..c987954b7c397e56d4d5ae6294b4991268ac86ea 100644 (file)
          }
       }
    }
+   /** FORMAT THE BCC STRING **/
+   $i = 0;
+   if (isset ($message->header->bcc[0]) && trim($message->header->bcc[0])){
+      $bcc_string = "";
+      $bcc_ary = $message->header->bcc;
+      while ($i < count(decodeHeader($bcc_ary))) {
+         $bcc_ary[$i] = htmlspecialchars($bcc_ary[$i]);
+         if ($bcc_string)
+            $bcc_string = "$bcc_string<BR>$bcc_ary[$i]";
+         else
+            $bcc_string = "$bcc_ary[$i]";
+   
+         $i++;
+         if (count($bcc_ary) > 1) {
+            if ($show_more_cc == false) {
+               if ($i == 1) {
+                  if (isset($where) && isset($what)) {
+                     // from a search
+                     $bcc_string = "$bcc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
+                  } else {
+                     $bcc_string = "$bcc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
+                  }   
+                  $i = count($bcc_ary);
+               }
+            } else if ($i == 1) {
+               if (isset($where) && isset($what)) {
+                  // from a search
+                  $bcc_string = "$bcc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
+               } else {
+                  $bcc_string = "$bcc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
+               }   
+            }
+         }
+      }
+   }
    /** make sure everything will display in HTML format **/
    $from_name = decodeHeader(htmlspecialchars($message->header->from));
    $subject = decodeHeader(htmlspecialchars($message->header->subject));
            '         </TD>' . "\n" .
            '      </TR>' . "\n";
    }
+   /** bcc **/
+   if (isset($bcc_string)) {
+      echo "      <TR>\n" .
+           "         <TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" .
+           '            Bcc:' . "\n" .
+           "         </TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>\n" .
+           "            <B>$bcc_string</B>&nbsp;\n" .
+           '         </TD>' . "\n" .
+           '      </TR>' . "\n";
+   }
    do_hook("read_body_header");
    echo '</TABLE>' .
         '   </TD></TR>' .