Bugzilla – Attachment 126436 Details for
Bug 28729
Return-path header not set in emails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28729: Reverse 'sender' and 'from'
Bug-28729-Reverse-sender-and-from.patch (text/plain), 2.08 KB, created by
Martin Renvoize (ashimema)
on 2021-10-18 13:48:25 UTC
(
hide
)
Description:
Bug 28729: Reverse 'sender' and 'from'
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-18 13:48:25 UTC
Size:
2.08 KB
patch
obsolete
>From 02cbbcce283e2fc06ec4830ae3b866d1702e4860 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 18 Oct 2021 14:44:48 +0100 >Subject: [PATCH] Bug 28729: Reverse 'sender' and 'from' > >Having read through the docs for both Email::Stuffer (Email::Sender) and >Mail::Sendmail, I believe the meaning of 'from' and 'Sender' has >reversed between the two modules. > >Email::Sendmail interpreted 'from' as the from address of the mail and >used Sender as an override for the envelope when it was passed. However, >in Email::Stuffer the 'from' is set at the envelope level and thus sets >the connection 'MAIL FROM' which is subsequently used as the return-path >by the mail server. It then uses 'Sender' as the message from address if >one is passed in as a header. > >This patch reverses our handling of those attribute in Koha::Email. >--- > Koha/Email.pm | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/Koha/Email.pm b/Koha/Email.pm >index cac63763ab..2047bc4e6f 100644 >--- a/Koha/Email.pm >+++ b/Koha/Email.pm >@@ -76,7 +76,11 @@ sub create { > my ( $self, $params ) = @_; > > my $args = {}; >- $args->{from} = $params->{from} || C4::Context->preference('KohaAdminEmailAddress'); >+ $args->{from} = >+ $params->{sender} >+ || C4::Context->preference('ReturnpathDefault') >+ || $params->{from} >+ || C4::Context->preference('KohaAdminEmailAddress'); > Koha::Exceptions::BadParameter->throw( > error => "Invalid 'from' parameter: " . $args->{from}, > parameter => 'from' >@@ -101,9 +105,8 @@ sub create { > $addresses->{reply_to} ||= C4::Context->preference('ReplytoDefault') > if C4::Context->preference('ReplytoDefault'); > >- $addresses->{sender} = $params->{sender}; >- $addresses->{sender} ||= C4::Context->preference('ReturnpathDefault') >- if C4::Context->preference('ReturnpathDefault'); >+ $addresses->{sender} = >+ $params->{from} || C4::Context->preference('KohaAdminEmailAddress'); > > unless ( C4::Context->preference('SendAllEmailsTo') ) { > $addresses->{cc} = $params->{cc} >-- >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 28729
:
126436
|
126526
|
126527
|
127016
|
127017
|
127085
|
127086
|
127094