summaryrefslogtreecommitdiff
path: root/rt/lib/RT/EmailParser.pm
diff options
context:
space:
mode:
authorivan <ivan>2010-05-18 18:49:59 +0000
committerivan <ivan>2010-05-18 18:49:59 +0000
commit624b2d44625f69d71175c3348cae635d580c890b (patch)
treeed57a90db2ecbc72cea6c1d3c175c1dcd1938ab4 /rt/lib/RT/EmailParser.pm
parent7f4aff45cd6ef2f630d538294fa9d9c4db4ac4aa (diff)
parente70abd21bab68b23488f7ef1ee2e693a3b365691 (diff)
This commit was generated by cvs2svn to compensate for changes in r9232,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/RT/EmailParser.pm')
-rw-r--r--rt/lib/RT/EmailParser.pm35
1 files changed, 20 insertions, 15 deletions
diff --git a/rt/lib/RT/EmailParser.pm b/rt/lib/RT/EmailParser.pm
index 7890f495f..63c769836 100644
--- a/rt/lib/RT/EmailParser.pm
+++ b/rt/lib/RT/EmailParser.pm
@@ -289,9 +289,7 @@ email address and anything that the RT->Config->Get('RTAddressRegexp') matches.
=cut
sub ParseCcAddressesFromHead {
-
my $self = shift;
-
my %args = (
QueueObj => undef,
CurrentUser => undef,
@@ -307,10 +305,8 @@ sub ParseCcAddressesFromHead {
my $Address = $AddrObj->address;
my $user = RT::User->new($RT::SystemUser);
$Address = $user->CanonicalizeEmailAddress($Address);
- next if ( lc $args{'CurrentUser'}->EmailAddress eq lc $Address );
- next if ( lc $args{'QueueObj'}->CorrespondAddress eq lc $Address );
- next if ( lc $args{'QueueObj'}->CommentAddress eq lc $Address );
- next if ( $self->IsRTAddress($Address) );
+ next if lc $args{'CurrentUser'}->EmailAddress eq lc $Address;
+ next if $self->IsRTAddress($Address);
push ( @Addresses, $Address );
}
@@ -318,8 +314,6 @@ sub ParseCcAddressesFromHead {
}
-
-
=head2 IsRTaddress ADDRESS
Takes a single parameter, an email address.
@@ -333,16 +327,27 @@ sub IsRTAddress {
my $self = shift;
my $address = shift;
- # Example: the following rule would tell RT not to Cc
- # "tickets@noc.example.com"
- my $address_re = RT->Config->Get('RTAddressRegexp');
- if ( defined $address_re && $address =~ /$address_re/i ) {
- return 1;
+ if ( my $address_re = RT->Config->Get('RTAddressRegexp') ) {
+ return $address =~ /$address_re/i ? 1 : undef;
}
- return undef;
-}
+ # we don't warn here, but do in config check
+ if ( my $correspond_address = RT->Config->Get('CorrespondAddress') ) {
+ return 1 if lc $correspond_address eq lc $address;
+ }
+ if ( my $comment_address = RT->Config->Get('CommentAddress') ) {
+ return 1 if lc $comment_address eq lc $address;
+ }
+
+ my $queue = RT::Queue->new( $RT::SystemUser );
+ $queue->LoadByCols( CorrespondAddress => $address );
+ return 1 if $queue->id;
+ $queue->LoadByCols( CommentAddress => $address );
+ return 1 if $queue->id;
+
+ return undef;
+}
=head2 CullRTAddresses ARRAY