Bugzilla – Attachment 118716 Details for
Bug 26705
System preference NoticeBcc not working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26705: (QA follow-up) Do not rely on latest Email::MIME
Bug-26705-QA-follow-up-Do-not-rely-on-latest-Email.patch (text/plain), 2.33 KB, created by
Kyle M Hall (khall)
on 2021-03-24 10:41:22 UTC
(
hide
)
Description:
Bug 26705: (QA follow-up) Do not rely on latest Email::MIME
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-03-24 10:41:22 UTC
Size:
2.33 KB
patch
obsolete
>From 0b3313f55066f1c06b4806ae6a6eebf9be962d5b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 23 Mar 2021 16:58:04 -0300 >Subject: [PATCH] Bug 26705: (QA follow-up) Do not rely on latest Email::MIME > >This patch makes the implementation use lower-level methods to deal with >headers. So the Email::MIME library in Debian 9 works. > >Params are sorted for testing purposes. > >To test: >1. Apply this patch >2. Run the tests >=> SUCCESS: Things pass in D9+ >3. Sign off :-D > >Thanks Kyle! > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Email.pm | 12 +++++++----- > t/Koha/Email.t | 7 ++++--- > 2 files changed, 11 insertions(+), 8 deletions(-) > >diff --git a/Koha/Email.pm b/Koha/Email.pm >index 450e4015cd..cb1046f731 100644 >--- a/Koha/Email.pm >+++ b/Koha/Email.pm >@@ -22,6 +22,8 @@ use Modern::Perl; > > use Email::Valid; > use Email::MessageID; >+use List::Util qw(pairs); >+ > use Koha::Exceptions; > > use C4::Context; >@@ -153,11 +155,11 @@ sub send_or_die { > > my @recipients; > >- # extract all recipient addresses from header >- foreach my $header ( 'To', 'Cc', 'Bcc' ) { >- push @recipients, >- map { $_->as_string } >- $self->email->header_obj->header_as_obj($header)->addresses; >+ my @headers = $self->email->header_str_pairs; >+ foreach my $pair ( pairs @headers ) { >+ my ( $header, $value ) = @$pair; >+ push @recipients, split (', ', $value) >+ if grep { $_ eq $header } ('To', 'Cc', 'Bcc'); > } > > # Remove the Bcc header >diff --git a/t/Koha/Email.t b/t/Koha/Email.t >index 7d383c05e8..6955a3d678 100755 >--- a/t/Koha/Email.t >+++ b/t/Koha/Email.t >@@ -226,11 +226,12 @@ subtest 'send_or_die() tests' => sub { > 'If explicitly passed, "to" is preserved' ); > > $THE_email->send_or_die( { transport => $transport } ); >+ my @to = sort @{ $args->{to} }; > is_deeply( >- $args->{to}, >+ [@to], > [ >- 'to@example.com', 'cc@example.com', >- 'bcc_1@example.com', 'bcc_2@example.com' >+ 'bcc_1@example.com', 'bcc_2@example.com', >+ 'cc@example.com', 'to@example.com', > ], > 'If "to" is not explicitly passed, extract recipients from headers' > ); >-- >2.24.1 (Apple Git-126)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26705
:
118659
|
118660
|
118663
|
118664
|
118665
|
118704
|
118705
|
118713
|
118714
|
118715
| 118716