[rt-devel] SendEmail.pm Blacklist Bug

Phil Homewood pdh at snapgear.com
Thu Aug 29 02:03:38 EDT 2002


Douglas E. Warner wrote:
> Attached is a patch for SendEmail.pm that will allow the emails in 
> RT-Squelch-Replies-To to be blacklisted.  The regex was much too restrictive 
> before, since the entire header was on one line, the /^(stuff)$/ could never 
> possible happen.

Well picked. But the patch looks a little suboptimal to me. How
about this one instead? :-)

-- 
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh at snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances
-------------- next part --------------
Index: SendEmail.pm
===================================================================
RCS file: /cvs/local/rt/lib/RT/Action/SendEmail.pm,v
retrieving revision 1.2
diff -u -r1.2 SendEmail.pm
--- SendEmail.pm	12 Aug 2002 00:46:14 -0000	1.2
+++ SendEmail.pm	29 Aug 2002 05:58:46 -0000
@@ -68,10 +68,10 @@
     # If the transaction has content and has the header RT-Squelch-Replies-To
     
     if (defined $self->TransactionObj->Message->First()) { 
-	my $headers = $self->TransactionObj->Message->First->Headers();
+	my $squelch = $self->TransactionObj->Message->First->GetHeader('RT-Squelch-Replies-To');
 	
-	if ($headers =~ /^RT-Squelch-Replies-To: (.*?)$/si) {
-	    my @blacklist = split(/,/,$1);
+	if ($squelch) {
+	    my @blacklist = split(/,/,$squelch);
 	    
 	    # Cycle through the people we're sending to and pull out anyone on the
 	    # system blacklist


More information about the Rt-devel mailing list