Looking to write scrip based upon email header infomation

Hello,

We are looking to write a scrip to email a pager address if an email comes
into a queue with the priority set to high in the header. Can anyone point
me to a sample or give me a push in the right direction? I tried to adapt
this scrip (OnCreatePageOffHours - Request Tracker Wiki) but was
not successful.

Thanks for your help.

Jeremy

Hi Jeremy,

If you’re having problems with the scrip condition, try using this as a
User Defined condition:
my $Trans = $self->TransactionObj;
return $Trans->Type eq ‘Create’ &&
$Trans->Attachments->First->GetHeader(‘X-Priority’) =~ /^1\b/ ;

This will trigger the scrip if a new ticket is created and the e-mail that
created it has “X-Priority: 1” in the headers. You could also have it
trigger on priority 2 if you like (change the “/^1\b/” to
“/[1]\b/”). Priority 1 is “Highest” and 2 is “High”, at least in
Eudora’s world.

The action for this scrip would be a custom template that sends e-mail to
the pager address.

Regards,
Gene

At 09:07 AM 10/4/2007, Jeremy Stinson wrote:

Hello,

We are looking to write a scrip to email a pager address if an email comes
into a queue with the priority set to high in the header. Can anyone point
me to a sample or give me a push in the right direction? I tried to adapt
this scrip (OnCreatePageOffHours - Request Tracker Wiki) but
was not successful.

Thanks for your help.

Jeremy


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media. Buy a
copy at http://rtbook.bestpractical.com

Gene LeDuc, GSEC
Security Analyst
San Diego State University


  1. 12 ↩︎