diff options
author | mark <mark> | 2011-12-07 00:58:11 +0000 |
---|---|---|
committer | mark <mark> | 2011-12-07 00:58:11 +0000 |
commit | ff4e86db92ebc49762302c40dd31e0325f9afd1c (patch) | |
tree | 074bc6f6366f57e429e6ba482e83d156c45406c7 /rt/lib | |
parent | 167480801f938b021e2b06113cf9284bd3b6895b (diff) |
RT option to exclude certain Cc addresses, #15451
Diffstat (limited to 'rt/lib')
-rwxr-xr-x | rt/lib/RT/Interface/Email.pm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/rt/lib/RT/Interface/Email.pm b/rt/lib/RT/Interface/Email.pm index 401e970e8..9216887cd 100755 --- a/rt/lib/RT/Interface/Email.pm +++ b/rt/lib/RT/Interface/Email.pm @@ -997,13 +997,28 @@ sub ParseCcAddressesFromHead { my $user = $args{'CurrentUser'}->UserObj; return - grep $_ ne $current_address && !RT::EmailParser->IsRTAddress( $_ ), + grep { $_ ne $current_address + && !RT::EmailParser->IsRTAddress( $_ ) + && !IgnoreCcAddress( $_ ) + } map lc $user->CanonicalizeEmailAddress( $_->address ), map Email::Address->parse( $args{'Head'}->get( $_ ) ), qw(To Cc); } +=head2 IgnoreCcAddress ADDRESS +Returns true if ADDRESS matches the $IgnoreCcRegexp config variable. + +=cut + +sub IgnoreCcAddress { + my $address = shift; + if ( my $address_re = RT->Config->Get('IgnoreCcRegexp') ) { + return 1 if $address =~ /$address_re/i; + } + return undef; +} =head2 ParseSenderAddressFromHead HEAD |