[rt-users] OnCreateAutoReplyException using the To: address?

Adam Tingle adamtingle at gmail.com
Tue Mar 10 22:23:05 EDT 2009


I used the code from the wiki page at
http://wiki.bestpractical.com/view/OnCreateAutoReplyException to stop Auto
Replies from a list of addresses. This works great as it stops autoreplies
to certain requestors.

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 allusers at domain.com and delete the ticket right from
the Autoreply scrip, but for now I'm just trying to get it to not reply.

I borrowed some code from another wiki page (
http://wiki.bestpractical.com/view/AutomaticCustomFieldValue) that looks
like it does something similar (under CF values based on incoming To:
address), but it doesn't seem to work for me:

On Create Autoreply to Requestors: use template autoreply

Custom condition:
###
my @exceptionList = ('allemailusers at domain.com',
                     'mailer-daemon at rt.domain.com',
                     'postmaster at rt.domain.com');

my $transactionType = $self->TransactionObj->Type;
my $ticketRequestor = lc($self->TicketObj->RequestorAddresses);
my $to =
lc($self->TicketObj->Transactions->First->Attachments->First->GetHeader("To"));

if ($transactionType eq 'Create') {
  return if grep { $ticketRequestor eq lc($_) } @exceptionList;
  return if grep { $to eq lc($_) } @exceptionList;
  return 1;
}
return;
###

If anyone has any ideas on how to go about this, it would be much
appreciated.

- Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090310/635d66bb/attachment.htm>


More information about the rt-users mailing list