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

Frank Pater fpater at dca.net
Fri May 5 16:05:20 EDT 2006


Hi Romeo,

Try setting "Custom action preparation code:" to:
return 1;

This works for us. Also note that the code you have will delete any ticket with the string "Returned" in its subject. You may want to make it more specific:

if ($self->TicketObj->Subject =~ /^Returned mail/) {...}


This will delete only tickets where the first two words of the Subject are "Returned mail".

Sincerely,
Frank Pater
DCANet
http://www.dca.net
voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386

On Fri, May 05, 2006 at 03:50:13PM -0400, Romeo Theriault wrote:
> 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
> _______________________________________________
> 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
> 
> 
> We're hiring! Come hack Perl for Best Practical: 
> http://bestpractical.com/about/jobs.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20060505/e0820eb2/attachment.sig>


More information about the rt-users mailing list