Source for file view_header.php
Documentation is available at view_header.php
* This is the code to view the message header.
* @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: view_header.php 14845 2020-01-07 08:09:34Z pdontthink $
/** This is the view_header page */
define('PAGE_NAME', 'view_header');
* Include the SquirrelMail initialization file.
require
('../include/init.php');
/* SquirrelMail required files. */
require_once(SM_PATH .
'functions/imap.php');
require_once(SM_PATH .
'functions/url_parser.php');
* Extract message headers
* @param resource $imapConnection
* @param string $id Message ID
* @param string $passed_ent_id Nested/attached/embedded message ID (if any)
* @return array List of all message headers, where each
* element is a sub-array that contains two
* elements: header name and header value
* (in that order) where the header value is
* HTML-formatted, ready for display in browser
$header_output =
array();
$query =
"FETCH $id BODY[".
$passed_ent_id.
'.HEADER]';
for ($i=
1; $i <
count($read); $i++
) {
// FIXME: is the pipe character below a mistake? I think the original author might have thought it carried special meaning in the character class, which it does not... but then again, I am not currently trying to understand what this code actually does
case (preg_match('/^([^:]+):(.+)/', $line, $regs)):
$first[$i] =
$regs[1] .
':';
$second[$i] =
trim($line);
for ($i=
0; $i <
count($second); $i =
$j) {
$f =
(isset
($first[$i]) ?
$first[$i] :
'');
$s =
(isset
($second[$i]) ?
nl2br($second[$i]) :
'');
while (($first[$j] ==
'') &&
($j <
count($first))) {
$s .=
' ' .
nl2br($second[$j]);
/* do not mark these headers as emailaddresses */
if($lowf !=
'message-id:' &&
$lowf !=
'in-reply-to:' &&
$lowf !=
'references:') {
$header_output[] =
array($f,$s);
global $imap_stream_options; // in case not defined in config
$imapConnection =
sqimap_login($username, false, $imapServerAddress,
$imapPort, 0, $imap_stream_options);
$aTemplateHeaders =
array();
foreach ($header as $h) {
$aTemplateHeaders[] =
array (
$ret_addr =
SM_PATH .
'src/read_body.php?'.
$queryStr;
$oTemplate->assign('view_message_href', $ret_addr);
$oTemplate->assign('headers', $aTemplateHeaders);
$oTemplate->display('view_header.tpl');
$oTemplate->display('footer.tpl');
Documentation generated on Mon, 13 Jan 2020 04:23:45 +0100 by phpDocumentor 1.4.3