[Koha-bugs] [Bug 28729] Return-path header not set in emails

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Oct 19 17:19:00 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28729

--- Comment #41 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Hi Martin,

thanks a lot for looking into this! We'll try to test your fix, this is the
patch we have been running with meanwhile:

Set the envelope-from and therefore the return-path to sender.
---
 Koha/Email.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Koha/Email.pm b/Koha/Email.pm
index 9c077a6b84..068f8d9004 100644
--- a/Koha/Email.pm
+++ b/Koha/Email.pm
@@ -173,6 +173,9 @@ sub send_or_die {
         $args->{to} = \@recipients;
     }

+    $args->{from} = $self->email->header("Sender") ||
C4::Context->preference('KohaAdminEmailAddress');
+    Koha::Exceptions::BadParameter->throw("Invalid 'from' parameter:
".$args->{from})
+        unless Email::Valid->address( -address => $args->{from}, -fqdn => 0 );
# from is mandatory
     $self->SUPER::send_or_die($args);
 }

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list