[rt-devel] IsRTAddress and Ticket Watchers.

J. Sloan js138 at eng.cam.ac.uk
Tue Nov 25 07:49:07 EST 2003


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");
-       }
-
     }




More information about the Rt-devel mailing list