IsRTAddress and Ticket Watchers

Setting RTAddressRegexp in the config is good, but only has an effect on
the watchers parsed from CCs in new incoming messages. It has no effect
on watchers or requestors added to a ticket by any other means.

We frequently have tickets where the Requestor or Cc ends up being another
alias which points to RT, generating plenty of bounce messages, so I’ve
been looking at extending this mechanism.

The approach I’ve taken has involved modifying RT::ticket::_AddWatcher so
that it calls IsRTAddress appropriately and thus prevents this from ever
happening.

Anyone looked at doing anything similar, or any comments on this approach?

Thanks.

John

Diff of just that function in Ticket_Overlay/Local.pm

— _AddWatcher.pm 2003-11-25 12:46:38.000000000 +0000
+++ _AddWatcher.pm.orig 2003-11-25 12:35:34.000000000 +0000
@@ -1,5 +1,3 @@
-use RT::EmailParser;
sub _AddWatcher {
my $self = shift;
my %args = (
@@ -13,11 +11,6 @@

 my $principal = RT::Principal->new($self->CurrentUser);
 if ($args{'Email'}) {
  •   if (RT::EmailParser::IsRTAddress (undef, $args{'Email'})) {
    
  •       return (0, "That principal's email address is an RT
    

entrypoint");

  •    }
       my $user = RT::User->new($RT::SystemUser);
       my ($pid, $msg) = $user->LoadOrCreateByEmail($args{'Email'});
       if ($pid) {
    

@@ -26,12 +19,6 @@
}
if ($args{‘PrincipalId’}) {
$principal->Load($args{‘PrincipalId’});

  •   if ($principal->IsUser && RT::EmailParser::IsRTAddress (undef,
    
  •           $principal->Object->EmailAddress)) {
    
  •       return (0, "That principal's email address is an RT
    

entrypoint");

  •   }
    
    }

Setting RTAddressRegexp in the config is good, but only has an effect on
the watchers parsed from CCs in new incoming messages. It has no effect
on watchers or requestors added to a ticket by any other means.

Really? RT::Action::SendEmail calls out to the RT email address culling
routines for each and every watcher it should send to. It’d be worth
having a look there.

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

Setting RTAddressRegexp in the config is good, but only has an effect on
the watchers parsed from CCs in new incoming messages. It has no effect
on watchers or requestors added to a ticket by any other means.

Really? RT::Action::SendEmail calls out to the RT email address culling
routines for each and every watcher it should send to. It’d be worth
having a look there.

I think I spotted that once, then forgot about it :-/

This will work too, though in some ways it would be nicer for an error to
be generated if someone tries to add the Watcher also, rather than it
silently not delivering to where one might naively expect.

However since it involves less code changes, I think I’ll use this for
now.

Thanks.

John