RT NonCustomerEmailRegexp option, #15847
authormark <mark>
Thu, 19 Jan 2012 00:50:14 +0000 (00:50 +0000)
committermark <mark>
Thu, 19 Jan 2012 00:50:14 +0000 (00:50 +0000)
rt/etc/RT_Config.pm
rt/etc/RT_Config.pm.in
rt/lib/RT/Interface/Web_Vendor.pm

index 4995053..b4ca44c 100644 (file)
@@ -341,6 +341,18 @@ made of multiple email adresses.
 
 Set($ValidateUserEmailAddresses, undef);
 
+=item C<$NonCustomerEmailRegexp>
+
+Normally, when a ticket is linked to a customer, any requestors on that
+ticket that didn't previously have customer memberships are linked to 
+the customer also.  C<$NonCustomerEmailRegexp> is a regexp for email 
+addresses that should I<not> automatically be linked to a customer in 
+this way.
+
+=cut
+
+Set($NonCustomerEmailRegexp, undef);
+
 =item C<@MailPlugins>
 
 C<@MailPlugins> is a list of auth plugins for L<RT::Interface::Email>
index ae1bc88..94eea5a 100644 (file)
@@ -341,6 +341,18 @@ made of multiple email adresses.
 
 Set($ValidateUserEmailAddresses, undef);
 
+=item C<$NonCustomerEmailRegexp>
+
+Normally, when a ticket is linked to a customer, any requestors on that
+ticket that didn't previously have customer memberships are linked to 
+the customer also.  C<$NonCustomerEmailRegexp> is a regexp for email 
+addresses that should I<not> automatically be linked to a customer in 
+this way.
+
+=cut
+
+Set($NonCustomerEmailRegexp, undef);
+
 =item C<@MailPlugins>
 
 C<@MailPlugins> is a list of auth plugins for L<RT::Interface::Email>
index 129f69f..ee8c34b 100644 (file)
@@ -118,6 +118,14 @@ sub ProcessTicketCustomers {
     }
 
     ###
+    #remove any declared non-customer addresses
+    ###
+
+    my $exclude_regexp = RT->Config->Get('NonCustomerEmailRegexp');
+    @Requestors = grep { not $_->EmailAddress =~ $exclude_regexp } @Requestors
+      if defined $exclude_regexp;
+
+    ###
     #link ticket (and requestors) to customers
     ###