[rt-users] Delete message with /Returned mail/ in the subject line on arrival

Romeo Theriault romeotheriault at gmail.com
Fri May 5 15:50:13 EDT 2006


Hi, I'm trying to create a scrip with will delete a new ticket on  
arrival if it has "Returned mail" in the subject line. From searching  
through the mailing list archive for a while I've come up with  
something which I think is pretty close, yet it's not deleting these  
messages.

Here is what I have:

if ($self->TicketObj->Subject =~ /Returned/) {   $self->TicketObj- 
 >SetStatus('deleted'); 1; } else {   undef; }

I have this in the Custom condition field under Configuration >  
Global > Scrips > My Delete Scrip

The scrip fields are set as follows:

Description: Delete Returned Mail
Condition: On Create
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

I'm using RT 3.4.2.

Is my perl wrong or do I need to activate this somehow or attach it  
to a template? Or do I need to put this code in "Custom action  
perparation code: ??

Thank you for any help.

Romeo



More information about the rt-users mailing list