[rt-users] How to read custom email headers

Jonathan Scheidell jscheidell at secnap.net
Wed Dec 27 14:17:46 EST 2006


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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20061227/34a4b1d2/attachment.htm>


More information about the rt-users mailing list