[Bps-public-commit] RT-Extension-ListAllEmailRecipients branch, 4.2-backport, updated. ccf2d66cfcfa0a198a53cafc8f38286e9a205c9e
Shawn Moore
shawn at bestpractical.com
Fri Mar 10 15:15:32 EST 2017
The branch, 4.2-backport has been updated
via ccf2d66cfcfa0a198a53cafc8f38286e9a205c9e (commit)
from 9964f890e047f018d5694aa0c58bd6a9d4796792 (commit)
Summary of changes:
README | 6 +-
lib/RT/Extension/ListAllEmailRecipients.pm | 7 +-
lib/RT/Extension/ListAllEmailRecipients/Test.pm.in | 10 --
.../Email/Action/ListAllEmailRecipients.pm | 117 ---------------------
4 files changed, 11 insertions(+), 129 deletions(-)
delete mode 100644 lib/RT/Interface/Email/Action/ListAllEmailRecipients.pm
- Log -----------------------------------------------------------------
commit ccf2d66cfcfa0a198a53cafc8f38286e9a205c9e
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Fri Mar 10 20:13:31 2017 +0000
Remove 4.4 mailplugin and document patch
Definitely prefer the 4.4 way here :)
Tests pass under 4.2 now too
diff --git a/README b/README
index 1bddaa7..e185e24 100644
--- a/README
+++ b/README
@@ -21,7 +21,11 @@ INSTALLATION
Add these lines, both are required:
Plugin('RT::Extension::ListAllEmailRecipients');
- Set(@MailPlugins, qw(Auth::MailFrom Action::ListAllEmailRecipients));
+
+ Patch your RT
+ ListAllRecipients requires a patch for your RT instance.
+
+ patch -p1 < patches/add-mailgate-call.diff
Clear your mason cache
rm -rf /opt/rt4/var/mason_data/obj
diff --git a/lib/RT/Extension/ListAllEmailRecipients.pm b/lib/RT/Extension/ListAllEmailRecipients.pm
index 6dc8c9d..e8b6077 100644
--- a/lib/RT/Extension/ListAllEmailRecipients.pm
+++ b/lib/RT/Extension/ListAllEmailRecipients.pm
@@ -37,7 +37,12 @@ May need root permissions
Add these lines, both are required:
Plugin('RT::Extension::ListAllEmailRecipients');
- Set(@MailPlugins, qw(Auth::MailFrom Action::ListAllEmailRecipients));
+
+=item Patch your RT
+
+ListAllRecipients requires a patch for your RT instance.
+
+ patch -p1 < patches/add-mailgate-call.diff
=item Clear your mason cache
diff --git a/lib/RT/Extension/ListAllEmailRecipients/Test.pm.in b/lib/RT/Extension/ListAllEmailRecipients/Test.pm.in
index a4e85c9..1869130 100644
--- a/lib/RT/Extension/ListAllEmailRecipients/Test.pm.in
+++ b/lib/RT/Extension/ListAllEmailRecipients/Test.pm.in
@@ -36,14 +36,4 @@ sub import {
require RT::Extension::ListAllEmailRecipients;
}
-sub bootstrap_more_config{
- my $self = shift;
- my $config = shift;
- my $args_ref = shift;
-
- print $config "Set( \@MailPlugins, qw(Auth::MailFrom Action::ListAllEmailRecipients));\n";
-
- return;
-}
-
1;
diff --git a/lib/RT/Interface/Email/Action/ListAllEmailRecipients.pm b/lib/RT/Interface/Email/Action/ListAllEmailRecipients.pm
deleted file mode 100644
index 9960d67..0000000
--- a/lib/RT/Interface/Email/Action/ListAllEmailRecipients.pm
+++ /dev/null
@@ -1,117 +0,0 @@
-package RT::Interface::Email::Action::ListAllEmailRecipients;
-
-use strict;
-use warnings;
-
-use Role::Basic 'with';
-with 'RT::Interface::Email::Role';
-
-use RT::Interface::Email;
-
-=head1 NAME
-
-RT::Interface::Email::Action::ListAllEmailRecipeints
-
-=head1 SYNOPSIS
-
-This is a copy of RT's Action/Defaults.pm email plugin which is the
-default handler for comment and correspond. This version adds the
-call to process all email recipients and make the list available as
-a template variable. Otherwise, it is the same.
-
-=cut
-
-sub _HandleCreate {
- my %args = (
- Subject => undef,
- Message => undef,
- Ticket => undef,
- Queue => undef,
- @_,
- );
-
- my $head = $args{Message}->head;
-
- my @Cc;
- my @Requestors = ( $args{Ticket}->CurrentUser->id );
- if (RT->Config->Get('ParseNewMessageForTicketCcs')) {
- my $user = $args{Ticket}->CurrentUser->UserObj;
- my $current_address = lc $user->EmailAddress;
-
- @Cc =
- grep $_ ne $current_address && !RT::EmailParser->IsRTAddress( $_ ),
- map lc $user->CanonicalizeEmailAddress( $_->address ),
- map RT::EmailParser->CleanupAddresses( Email::Address->parse(
- Encode::decode( "UTF-8", $head->get( $_ ) ) ) ),
- qw(To Cc);
- }
-
- # ExtractTicketId may have been overridden, and edited the Subject
- my $subject = Encode::decode( "UTF-8", $head->get('Subject') );
- chomp $subject;
-
- RT::Extension::ListAllEmailRecipients::FindNotificationRecipients(
- Ticket => $args{'Ticket'},
- Queue => $args{Queue}->Id,
- Subject => $subject,
- Requestor => \@Requestors,
- Cc => \@Cc,
- MIMEObj => $args{Message},
- UpdateInterface => 'EmailCreate');
-
- my ( $id, $Transaction, $ErrStr ) = $args{Ticket}->Create(
- Queue => $args{Queue}->Id,
- Subject => $subject,
- Requestor => \@Requestors,
- Cc => \@Cc,
- MIMEObj => $args{Message},
- );
- return if $id;
-
- MailError(
- Subject => "Ticket creation failed: $args{Subject}",
- Explanation => $ErrStr,
- FAILURE => 1,
- );
-}
-
-sub HandleComment {
- _HandleEither( @_, Action => "Comment" );
-}
-
-sub HandleCorrespond {
- _HandleEither( @_, Action => "Correspond" );
-}
-
-
-sub _HandleEither {
- my %args = (
- Action => undef,
- Message => undef,
- Subject => undef,
- Ticket => undef,
- TicketId => undef,
- Queue => undef,
- @_,
- );
-
- return _HandleCreate(@_) unless $args{TicketId};
-
- unless ( $args{Ticket}->Id ) {
- MailError(
- Subject => "Message not recorded: $args{Subject}",
- Explanation => "Could not find a ticket with id " . $args{TicketId},
- FAILURE => 1,
- );
- }
-
- RT::Extension::ListAllEmailRecipients::FindNotificationRecipients(
- @_,
- UpdateInterface => 'Email');
-
- my $action = ucfirst $args{Action};
- my ( $status, $msg ) = $args{Ticket}->$action( MIMEObj => $args{Message} );
- return if $status;
-}
-
-1;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list