[rt-users] How to read custom email headers

Jonathan Scheidell jscheidell at secnap.net
Wed Dec 27 14:57:13 EST 2006


Thanks!!

That worked perfect

I added some logging to the script action.

[Wed Dec 27 19:56:34 2006] [notice]: joe at blow.com <-- this is X-ISP.


-- 
Jon Scheidell
Security Engineer
Secnap Network Security
(561) 999-5000 x:4110
www.secnap.com
 

-----Original Message-----
From: Ruslan Zakirov [mailto:ruslan.zakirov at gmail.com] 
Sent: Wednesday, December 27, 2006 2:50 PM
To: Jonathan Scheidell
Cc: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] How to read custom email headers

my $attachment = $self->TransactionObj->Attachments->First;
my $isp = $attachment->GetHeader('X-ISP');
I think this should work.

On 12/27/06, Jonathan Scheidell <jscheidell at secnap.net> wrote:
>
>
>
>
> I'm trying to read an email address from a custom header I created and
> assign that variable as a ticket cc.
>
>
>
> I have RT pulling addresses from the From:, and Cc: fields in the
header,
> but I want it to pull an address from a custom header (ie. X-Custom:
> joe at somewhere.com).
>
>
>
> I have been testing some custom script actions to try and read the
header,
> but as of yet have been unsuccessful.
>
>
>
> I looked through the wiki, and historic rt-users lists, but didn't
find
> anything that helped much.
>
>
>
> I got this to work once on RT3.4 by manually changing the source code
(I
> think it was the Notify.pm script) but can't seem to find
documentation on
> that.
>
>
>
> This time around, with RT3.6 I would like to do this with custom
script
> actions, that seems to be the "cleanest" way to do it.
>
>
>
> Here is some of my bumbling so far, I'm trying to tackle the reading
portion
> first:
>
> The header field is "X-Isp:"
>
>
>
> Condition:          On Create
>
> Action:              User Defined
>
>
>
> Cleanup Code:
>
>
>
> my $MIMEObj = $self->TemplateObj->MIMEObj;
>
> my $isp = $MIMEObj->head->get('X-Isp');
>
>
>
> $RT::Logger->notice($isp.  " <-- this is X-ISP.\n");
>
>
>
> return 1;
>
>
>
>
>
> This yields me an error in the rt.log:
>
> Commit failed: Can't call method "head" on an undefined value at (eval
475)
> line 3.
>
>
>
> I'm not sure if there is some additional functions library I need to
include
> that is not in General.pm, but with my limited knowledge of perl I'm
having
> a hard time getting through this.
>
>
>
> --
>
> Jon Scheidell
>
> Security Engineer
>
> Secnap Network Security
>
> (561) 999-5000 x:4110
>
> www.secnap.com
>
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
>


-- 
Best regards, Ruslan.




More information about the rt-users mailing list