[Rt-commit] r7521 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Mon Apr 16 09:05:24 EDT 2007
Author: ruz
Date: Mon Apr 16 09:05:23 2007
New Revision: 7521
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm
Log:
r4941 at cubic-pc: cubic | 2007-04-16 15:06:16 +0400
* minor refactoring
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Interface/Email.pm Mon Apr 16 09:05:23 2007
@@ -706,23 +706,22 @@
@_
);
- my (@Addresses);
+ my @recipients =
+ map lc $_->address,
+ map Mail::Address->parse( $args{'Head'}->get( $_ ) ),
+ qw(To Cc);
+
+ my @res;
+ foreach my $address ( @recipients ) {
+ $address = $args{'CurrentUser'}->UserObj->CanonicalizeEmailAddress( $address );
+ next if lc $args{'CurrentUser'}->EmailAddress eq $address;
+ next if lc $args{'QueueObj'}->CorrespondAddress eq $address;
+ next if lc $args{'QueueObj'}->CommentAddress eq $address;
+ next if IsRTAddress( $address );
- my @ToObjs = Mail::Address->parse( $args{'Head'}->get('To') );
- my @CcObjs = Mail::Address->parse( $args{'Head'}->get('Cc') );
-
- foreach my $AddrObj ( @ToObjs, @CcObjs ) {
- my $Address = $AddrObj->address;
- $Address = $args{'CurrentUser'}
- ->UserObj->CanonicalizeEmailAddress($Address);
- next if ( $args{'CurrentUser'}->EmailAddress =~ /^\Q$Address\E$/i );
- next if ( $args{'QueueObj'}->CorrespondAddress =~ /^\Q$Address\E$/i );
- next if ( $args{'QueueObj'}->CommentAddress =~ /^\Q$Address\E$/i );
- next if ( RT::EmailParser->IsRTAddress($Address) );
-
- push( @Addresses, $Address );
+ push @res, $address;
}
- return (@Addresses);
+ return @res;
}
More information about the Rt-commit
mailing list