Missing headers on Download

All,

I have been scouring this list and Google for the answer to this issue and have been unable to find an answer. It seems like it would be common, so I am sorry if this has been asked before.

When we click on the “Download (untitled) / with headers” link we get some of the headers, but the FROM TO and SUBJECT are missing. Is there a way to change RT so that it does display those headers when we click that link?

Brian Schrock
Linux Administrator
Network Operations
The Garden City Group, Inc.
5151 Blazer Parkway Suite A
Dublin, ohio 43017
Telephone: 614-289-5457
Mobile: 614-745-5491
Email: Brian.Schrock@gardencitygroup.com

This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is confidential, privileged or legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation.

All,

I have been scouring this list and Google for the answer to this issue and
have been unable to find an answer. It seems like it would be common, so I
am sorry if this has been asked before.

When we click on the “Download (untitled) / with headers” link we get some
of the headers, but the FROM TO and SUBJECT are missing. Is there a way to
change RT so that it does display those headers when we click that link?

Probably you have multipart message and subject, from and many other
headers are only
on top part of the mail. This view is mostly for admins rather than mortals :slight_smile:

Brian Schrock
Linux Administrator
Network Operations
The Garden City Group, Inc.
5151 Blazer Parkway Suite A
Dublin, ohio 43017
Telephone: 614-289-5457
Mobile: 614-745-5491
Email: Brian.Schrock@gardencitygroup.com


This communication (including any attachments) is intended for the use of
the intended recipient(s) only and may contain information that is
confidential, privileged or legally protected. Any unauthorized use or
dissemination of this communication is strictly prohibited. If you have
received this communication in error, please immediately notify the sender
by return e-mail message and delete all copies of the original
communication. Thank you for your cooperation.

Best regards, Ruslan.

When we click on the “Download (untitled) / with headers” link we get some
of the headers, but the FROM TO and SUBJECT are missing. Is there a way to
change RT so that it does display those headers when we click that link?

Probably you have multipart message and subject, from and many other
headers are only
on top part of the mail. This view is mostly for admins rather than mortals :slight_smile:

A trick that generally works (but not always, esp. on high traffic RTs):

Click on the “with headers” link for the first part of the message
(usually text/* for multipart/ mail) and then subtract one from the
number at the end of the URL to get the top-level parent part with the
headers you want.

Thank you, I noticed the same thing so I am modifying the dhandler script to walk the attachment tree up to the parent until Parent=0.

rt3/html/Ticket/Attachment/WithHeaders/dhandler

my $AttachmentObjParent = new RT::Attachment( $session{‘CurrentUser’} );
$AttachmentObjParent->Load( $AttachmentObj->Parent );

And then I added this later in the file…
$m->out( $AttachmentObjParent->Headers );

Thanks for the response that is exactly the kind of info I needed.-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: Thursday, July 19, 2012 4:01 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Missing headers on Download

On 07/18/2012 02:47 PM, Ruslan Zakirov wrote:

When we click on the “Download (untitled) / with headers” link we get
some of the headers, but the FROM TO and SUBJECT are missing. Is
there a way to change RT so that it does display those headers when we click that link?

Probably you have multipart message and subject, from and many other
headers are only on top part of the mail. This view is mostly for
admins rather than mortals :slight_smile:

A trick that generally works (but not always, esp. on high traffic RTs):

Click on the “with headers” link for the first part of the message (usually text/* for multipart/ mail) and then subtract one from the number at the end of the URL to get the top-level parent part with the headers you want.

This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is confidential, privileged or legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation.

Here is how I solved it…

rt3/html/Ticket/Attachment/WithHeaders/dhandler

#Load Parent Attachment to get e-mail headers...
my $AttachmentObjParent = new RT::Attachment( $session{'CurrentUser'} );
my $parent = $AttachmentObj->Parent;
while ( $parent != 0 ) {
    $AttachmentObjParent->Load( $parent  );
    $parent = $AttachmentObjParent->Parent;
}

# XXX: should we check handle html here and integrate headers into html?
$r->content_type( $content_type );
$m->clear_buffer;
#$m->out( $AttachmentObj->EncodedHeaders( $enc ) );
#$m->out( $AttachmentObjParent->Headers );
my @headers = split( "\n", $AttachmentObjParent->Headers);
foreach my $header ( @headers ) {
    #$m->out( "\nAnother one:\n");
    #$m->out( $header );
    if ($header =~ /^(Subject|From|To|Date)/) {
            $m->out( "$header\n" );
    }
}
$m->out( "\n\n" );
$m->out( $AttachmentObj->OriginalContent );
$m->abort;From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Brian Schrock

Sent: Thursday, July 19, 2012 10:15 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Missing headers on Download

Thank you, I noticed the same thing so I am modifying the dhandler script to walk the attachment tree up to the parent until Parent=0.

rt3/html/Ticket/Attachment/WithHeaders/dhandler

my $AttachmentObjParent = new RT::Attachment( $session{‘CurrentUser’} ); $AttachmentObjParent->Load( $AttachmentObj->Parent );

And then I added this later in the file…
$m->out( $AttachmentObjParent->Headers );

Thanks for the response that is exactly the kind of info I needed.