[Rt-commit] rt branch, dont_squish_one_time_recipients, updated. rt-3.8.7-356-gba8128f
Ruslan Zakirov
ruz at bestpractical.com
Tue Apr 20 19:27:47 EDT 2010
The branch, dont_squish_one_time_recipients has been updated
via ba8128f9e297bdc6fac596de270c26c4a774b963 (commit)
via 1af68505f0b0c14240b88e3a1e2322accbcd0154 (commit)
via 8f1570556d600657f7c7ea7ff8c1463410a17251 (commit)
from d10b128ed7f2ecd44396329d8f6cffe1d7962dc6 (commit)
Summary of changes:
lib/RT/Action/Notify.pm | 20 ++++++++------------
lib/RT/Action/SendEmail.pm | 13 +++++++++++--
2 files changed, 19 insertions(+), 14 deletions(-)
- Log -----------------------------------------------------------------
commit 8f1570556d600657f7c7ea7ff8c1463410a17251
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Apr 21 01:05:55 2010 +0400
use `eq` op instead of regexp
diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index 8b682c1..cfa6e42 100755
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -824,7 +824,7 @@ sub RemoveInappropriateRecipients {
$RT::Logger->info( $msgid . "$addr appears to point to this RT instance. Skipping" );
next;
}
- if ( grep /^\Q$addr\E$/, @blacklist ) {
+ if ( grep $addr eq $_, @blacklist ) {
$RT::Logger->info( $msgid . "$addr was blacklisted for outbound mail on this transaction. Skipping");
next;
}
commit 1af68505f0b0c14240b88e3a1e2322accbcd0154
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Apr 21 03:20:54 2010 +0400
No squelch mode and no NotifyActor affect for One-time recipients
diff --git a/lib/RT/Action/Notify.pm b/lib/RT/Action/Notify.pm
index 3b782f3..6264fc2 100755
--- a/lib/RT/Action/Notify.pm
+++ b/lib/RT/Action/Notify.pm
@@ -87,17 +87,6 @@ sub SetRecipients {
my ( @To, @PseudoTo, @Cc, @Bcc );
- if ( $arg =~ /\bOtherRecipients\b/ ) {
- if ( my $attachment = $self->TransactionObj->Attachments->First ) {
- push @Cc, map { $_->address } Email::Address->parse(
- $attachment->GetHeader('RT-Send-Cc')
- );
- push @Bcc, map { $_->address } Email::Address->parse(
- $attachment->GetHeader('RT-Send-Bcc')
- );
- }
- }
-
if ( $arg =~ /\bRequestor\b/ ) {
push @To, $ticket->Requestors->MemberEmailAddresses;
}
@@ -159,7 +148,14 @@ sub SetRecipients {
}
@{ $self->{'PseudoTo'} } = @PseudoTo;
-
+ if ( $arg =~ /\bOtherRecipients\b/ ) {
+ if ( my $attachment = $self->TransactionObj->Attachments->First ) {
+ push @{ $self->{'NoSquelch'}{'Cc'} ||= [] }, map $_->address,
+ Email::Address->parse( $attachment->GetHeader('RT-Send-Cc') );
+ push @{ $self->{'NoSquelch'}{'Bcc'} ||= [] }, map $_->address,
+ Email::Address->parse( $attachment->GetHeader('RT-Send-Bcc') );
+ }
+ }
}
eval "require RT::Action::Notify_Vendor";
diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index cfa6e42..900917f 100755
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -830,6 +830,14 @@ sub RemoveInappropriateRecipients {
}
push @addrs, $addr;
}
+ foreach my $addr ( @{ $self->{'NoSquelch'}{$type} || [] } ) {
+ # never send email to itself
+ if ( !RT::EmailParser->CullRTAddresses($addr) ) {
+ $RT::Logger->info( $msgid . "$addr appears to point to this RT instance. Skipping" );
+ next;
+ }
+ push @addrs, $addr;
+ }
@{ $self->{$type} } = @addrs;
}
}
commit ba8128f9e297bdc6fac596de270c26c4a774b963
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Apr 21 03:22:32 2010 +0400
minor
diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index 900917f..20ed126 100755
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -812,7 +812,8 @@ sub RemoveInappropriateRecipients {
# system blacklist
# Trim leading and trailing spaces.
- @blacklist = map { RT::User->CanonicalizeEmailAddress( $_->address ) } Email::Address->parse(join(', ', grep {defined} @blacklist));
+ @blacklist = map { RT::User->CanonicalizeEmailAddress( $_->address ) }
+ Email::Address->parse( join ', ', grep defined, @blacklist );
foreach my $type (@EMAIL_RECIPIENT_HEADERS) {
my @addrs;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list