[rt-users] Missing headers on Download

Brian Schrock Brian.Schrock at gardencitygroup.com
Thu Jul 19 10:53:09 EDT 2012


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;


-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Brian Schrock
Sent: Thursday, July 19, 2012 10:15 AM
To: rt-users at 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.

-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: Thursday, July 19, 2012 4:01 AM
To: rt-users at 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 :)

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.


More information about the rt-users mailing list