From 853b543dbd57499c467ed029bbf33ea25d306c55 Mon Sep 17 00:00:00 2001 From: fallas Date: Mon, 29 Oct 2001 14:48:02 +0000 Subject: [PATCH] Modified to return bcc header if available, for save as draft. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1648 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 11 +++++++++ src/read_body.php | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 4cef81eb..a3b81d98 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -451,6 +451,17 @@ $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; diff --git a/src/read_body.php b/src/read_body.php index a47817b1..c987954b 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -299,6 +299,41 @@ } } } + /** 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
$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 ($echo_more)"; + } else { + $bcc_string = "$bcc_string ($echo_more)"; + } + $i = count($bcc_ary); + } + } else if ($i == 1) { + if (isset($where) && isset($what)) { + // from a search + $bcc_string = "$bcc_string ($echo_less)"; + } else { + $bcc_string = "$bcc_string ($echo_less)"; + } + } + } + } + } /** make sure everything will display in HTML format **/ $from_name = decodeHeader(htmlspecialchars($message->header->from)); $subject = decodeHeader(htmlspecialchars($message->header->subject)); @@ -421,6 +456,16 @@ ' ' . "\n" . ' ' . "\n"; } + /** bcc **/ + if (isset($bcc_string)) { + echo " \n" . + " \n" . + ' Bcc:' . "\n" . + " \n" . + " $bcc_string \n" . + ' ' . "\n" . + ' ' . "\n"; + } do_hook("read_body_header"); echo '' . ' ' . -- 2.25.1