X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fread_body.php;h=6f7e3c13849a1661d2f7826de80723644c3688d0;hb=4dea7315db37a788bb396ce27788c394e6cba224;hp=c20a455081f5bfe6aa5b60d1bea7bd4528fb9e07;hpb=11307a4c707a22ef7dc2530b0e33c2afa5329e58;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index c20a4550..6f7e3c13 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,38 +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 " |