I used the code from the wiki page at <a href="http://wiki.bestpractical.com/view/OnCreateAutoReplyException">http://wiki.bestpractical.com/view/OnCreateAutoReplyException</a> to stop Auto Replies from a list of addresses. This works great as it stops autoreplies to certain requestors.<br>
<br>Now, I'd like to do something something similar, but checking the To: address instead of the Requestor (From: or Reply-To:) address. The reason being, there are a number of email groups already set up that blast messages to entire groups, departments and even the dreaded 'All Email Users' list. This ends up creating half a dozen new tickets for a single message sent to a group which includes the RT queue addresses. Ideally, I'd like to catch a message being sent to <a href="mailto:allusers@domain.com">allusers@domain.com</a> and delete the ticket right from the Autoreply scrip, but for now I'm just trying to get it to not reply.<br clear="all">
<br>I borrowed some code from another wiki page (<a href="http://wiki.bestpractical.com/view/AutomaticCustomFieldValue">http://wiki.bestpractical.com/view/AutomaticCustomFieldValue</a>) that looks like it does something similar (under CF values based on incoming To: address), but it doesn't seem to work for me:<br>
<br>On Create Autoreply to Requestors: use template autoreply<br><br>Custom condition:<br>###<br>my @exceptionList = ('<a href="mailto:allemailusers@domain.com">allemailusers@domain.com</a>',<br> '<a href="mailto:mailer-daemon@rt.domain.com">mailer-daemon@rt.domain.com</a>',<br>
'<a href="mailto:postmaster@rt.domain.com">postmaster@rt.domain.com</a>');<br><br>my $transactionType = $self->TransactionObj->Type;<br>my $ticketRequestor = lc($self->TicketObj->RequestorAddresses);<br>
my $to = lc($self->TicketObj->Transactions->First->Attachments->First->GetHeader("To"));<br><br>if ($transactionType eq 'Create') {<br> return if grep { $ticketRequestor eq lc($_) } @exceptionList;<br>
return if grep { $to eq lc($_) } @exceptionList;<br> return 1;<br>}<br>return;<br>###<br><br>If anyone has any ideas on how to go about this, it would be much appreciated. <br><br>- Adam<br>