X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=c987954b7c397e56d4d5ae6294b4991268ac86ea;hb=849bdf42ed7bd7cca68909d2b46869742dfd210e;hp=838e402c915bfb8c4803ed5a0d10a8a81a493e65;hpb=32c7898caf59016a8b858f2dc3beb7f9e0049064;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 838e402c..c987954b 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,45 +1,241 @@ - - include("../config/config.php"); - include("../functions/strings.php"); - include("../functions/page_header.php"); - include("../functions/imap.php"); - include("../functions/mime.php"); - include("../functions/mailbox.php"); - include("../functions/date.php"); +' . + '
';
- // $message contains all information about the message
- // including header and body
- $message = fetchMessage($imapConnection, $passed_id, $mailbox);
+ $cnum = 0;
+ for ($i=1; $i < count($read); $i++) {
+ $line = htmlspecialchars($read[$i]);
+ if (eregi("^>", $line)) {
+ $second[$i] = $line;
+ $first[$i] = ' ';
+ $cnum++;
+ } else if (eregi("^[ |\t]", $line)) {
+ $second[$i] = $line;
+ $first[$i] = '';
+ } else if (eregi("^([^:]+):(.+)", $line, $regs)) {
+ $first[$i] = $regs[1] . ':';
+ $second[$i] = $regs[2];
+ $cnum++;
+ } else {
+ $second[$i] = trim($line);
+ $first[$i] = '';
+ }
+ }
+ for ($i=0; $i < count($second); $i = $j) {
+ if (isset($first[$i]))
+ $f = $first[$i];
+ if (isset($second[$i]))
+ $s = nl2br($second[$i]);
+ $j = $i + 1;
+ while ($first[$j] == '' && $j < count($first)) {
+ $s .= ' ' . nl2br($second[$j]);
+ $j++;
+ }
+ parseEmail($s);
+ if (isset($f)) echo " |