saaiber
03-14-2008, 07:35 AM
In the admin panel you can change the settings to save raw email headers. But where in the osTicket system can I view them? I think they aren't saved or at least not shown anywhere.
Grtz,
Nic
In the admin panel you can change the settings to save raw email headers. But where in the osTicket system can I view them? I think they aren't saved or at least not shown anywhere.
Grtz,
Nic
Hi, I also didnt find 'View headers' option so I made it by myself, on the eticket basis:
First, I`ve changed viewticket.php in the /include/staff/ directory
At the beggining I need to change Select:
//get messages
$sql='SELECT msg.msg_id,msg.created,msg.message,count(attach_id ) as attachments FROM '.TICKET_MESSAGE_TABLE.' msg '.
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE." attach ON msg.ticket_id=attach.ticket_id AND msg.msg_id=attach.ref_id AND ref_type='M' ".
' WHERE msg.ticket_id='.db_input($id).
' GROUP BY msg.msg_id ORDER BY created';
to:
//get messages
$sql='SELECT msg.msg_id,msg.headers,msg.created,msg.message,cou nt(attach_id) as attachments FROM '.TICKET_MESSAGE_TABLE.' msg '.
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE." attach ON msg.ticket_id=attach.ticket_id AND msg.msg_id=attach.ref_id AND ref_type='M' ".
' WHERE msg.ticket_id='.db_input($id).
' GROUP BY msg.msg_id ORDER BY created';
Just below these lines:
<?if($msg_row['attachments']>0){ ?>
<tr class="header"><td><?=$ticket->getAttachmentStr($msg_row['msg_id'],'M')?></td></tr>
<?}?>
I`ve added this code:
<?php if ($msg_row['headers']) { ?>
<tr class="header"><td><a target="checkHeader" href="#" onclick="window.open('<PUT_LINK_TO_HEADER_FILE_HERE>?msg=<?=$msg_row['msg_id']?>', 'checkHeader', 'menubar=no,toolbar=no,location=no,directories=no, status=no,scrollbars=yes,resizable=yes,fullscreen= no,channelmode=no,width=720,height=490').focus(); return false">Headers</a></td></tr>
<?php } ?>
Next, I`ve made new file in the scp directory, lets call it headers.php:
<?php
header('Content-type: text/plain;');
//fill the DB details below
$serveraddr='';
$login='';
$password='';
$db='';
$my = mysql_connect($serveraddr, $login, $password) OR die("Check DB settings");
mysql_select_db($db, $my);
$message = mysql_fetch_array(mysql_query("SELECT headers FROM ost_ticket_message WHERE msg_id='$_GET[msg]'"));
$headers=$message[headers];
$headers=stripslashes(str_replace('\n',"\n",$headers));
echo $headers;
?>
Maybe my solution isnt pr0, but it works ^^
I hope it will help you ;)
Greets Art