https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28729
David Nind <da...@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #126527|0 |1 is obsolete| | --- Comment #48 from David Nind <da...@davidnind.com> --- Created attachment 127017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127017&action=edit Bug 28729: Make Koha::Email->send_or_die handle returnpath Koha used to rely on Mail::Sendmail for sending emails. As an SMTP client, the library would extract the from address from the Sender header to pass along in the MAIL FROM: field of the SMTP protocol [1]. This was overlooked when we moved to Email::Stuffer/Email::Simple and there's a different behavior as it expects the envelope to be passed and falls back to extracting the 'From' header when said envelope is not found [2]. This patchset re-introduces the behavior from Mail::Sendmail by overriding the send_or_die method locally (in Koha::Email) and doing the right thing. Unless an explicit {from} parameter is passed, it extracts the MAIL FROM envelope from the Sender header, as Mail::Sendmail did, and calls $self->SUPER::send_or_die with the right parameters. To test: 1. Apply the unit tests 2. Run: $ kshell k$ prove t/Koha/Email.t => FAIL: Sender is not handled correctly! 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! The from parameter is correct! No Sender header sent! 5. Sign off :-D [1] https://metacpan.org/dist/Mail-Sendmail/source/lib/Mail/Sendmail.pm#L284 [2] https://metacpan.org/pod/Email::Sender::Manual::QuickStart#envelope-information Signed-off-by: David Nind <da...@davidnind.com> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/