X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fread_body.php;h=dc3c308af3c261d72ceeb560417b753cf75f1ef4;hp=256a05aee57c6f348244b19eaa5e95170fc532fc;hb=508c06bf020df744a978fc85b6222bfa24f95d54;hpb=7c9499e1836d574fc0b398e45d912f6c2d032aac diff --git a/src/read_body.php b/src/read_body.php index 256a05ae..dc3c308a 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -1,37 +1,142 @@ - - 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"); - - $imapConnection = loginToImapServer($username, $key, $imapServerAddress); - selectMailbox($imapConnection, $mailbox, $numMessages); +"; - echo ""; - echo "
\n"; + include("../src/load_prefs.php"); + $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + sqimap_mailbox_select($imapConnection, $mailbox); displayPageHeader($color, $mailbox); + if ($view_hdr) { + fputs ($imapConnection, "a003 FETCH $passed_id BODY[HEADER]\r\n"); + $read = sqimap_read_data ($imapConnection, "a003", true, $a, $b); + + echo ""; + for ($i=1; $i < count($read)-1; $i++) { + $read[$i] = htmlspecialchars($read[$i]); + if (substr($read[$i], 0, 1) != "\t" && + substr($read[$i], 0, 1) != " " && + substr($read[$i], 0, 1) != "&" && + trim($read[$i])) { + $pre = substr($read[$i], 0, strpos($read[$i], ":")); + $read[$i] = str_replace("$pre", "$pre", decodeHeader($read[$i])); + } + echo "$read[$i]"; + } + echo " |