Bugzilla – Attachment 122062 Details for
Bug 28581
Patron's queue_notice uses inbound_email_address incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28581: Do not send mail without a from address
Bug-28581-Do-not-send-mail-without-a-from-address.patch (text/plain), 1.75 KB, created by
Marcel de Rooy
on 2021-06-17 12:12:02 UTC
(
hide
)
Description:
Bug 28581: Do not send mail without a from address
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-06-17 12:12:02 UTC
Size:
1.75 KB
patch
obsolete
>From bcb14e869ebd1cde512c0bebeda0df2594a2fa65 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 17 Jun 2021 09:18:47 +0000 >Subject: [PATCH] Bug 28581: Do not send mail without a from address >Content-Type: text/plain; charset=utf-8 > >Test plan: >Make branch mail empty and KohaAdminEmailAddress. >Trigger a message that goes thru the message queue. >Check the log for a warning. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Letters.pm | 5 +++++ > Koha/Patron.pm | 5 +++++ > 2 files changed, 10 insertions(+) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index d2a3f1265b..b38bdeaa46 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -925,6 +925,11 @@ sub EnqueueLetter { > # return unless exists $params->{'borrowernumber'}; > return unless exists $params->{'message_transport_type'}; > >+ if( !$params->{from_address} ) { >+ warn 'EnqueueLetter: Sending a message without from_address not allowed.'; >+ return; # no exception: context contains various silent returns >+ } >+ > my $content = $params->{letter}->{content}; > $content =~ s/\s+//g if(defined $content); > if ( not defined $content or $content eq '' ) { >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index a8379f6228..4c5960083e 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1875,6 +1875,11 @@ sub queue_notice { > > my $library = Koha::Libraries->find( $letter_params->{branchcode} ); > my $from_email_address = $library->from_email_address; >+ if( !$from_email_address ) { >+ # No exception since we 'silently' return here for various reasons.. >+ warn 'queue_notice: Found no branch email address; KohaAdminEmailAddress is empty too.'; >+ return; >+ } > > my @message_transports; > my $letter_code; >-- >2.20.1
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 28581
:
122056
|
122057
|
122061
|
122062
|
122063
|
122067
|
122068
|
122071
|
122072
|
122073
|
122074
|
122075
|
122076
|
122078
|
122080
|
122081
|
122136
|
122137
|
122138
|
122139
|
122140
|
122212