X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=788aa858fe3a98bda4a0f267fe8e879170ce2007;hb=b61ed24d8a140c29d4a1ca2d918719094963aa4f;hp=768e4860ad7ded34c4573d5363ce5cf99ce9e0ed;hpb=a054feae68835f2b505257144f88ac8db830d94d;p=squirrelmail.git diff --git a/src/read_body.php b/src/read_body.php index 768e4860..788aa858 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,45 +1,219 @@ - - 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"); +"; - echo "
\n"; + include('../src/load_prefs.php'); + $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + sqimap_mailbox_select($imapConnection, $mailbox); + do_hook('html_top'); displayPageHeader($color, $mailbox); + if (isset($view_hdr)) { + fputs ($imapConnection, "a003 FETCH $passed_id BODY[HEADER]\r\n"); + $read = sqimap_read_data ($imapConnection, "a003", true, $a, $b); + + echo '';
+
+ $cnum = 0;
+ for ($i=1; $i < count($read)-1; $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 " |