[Koha-bugs] [Bug 26705] System preference NoticeBcc not working

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 23 15:27:09 CET 2021


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #118660|0                           |1
        is obsolete|                            |

--- Comment #15 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 118664
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118664&action=edit
Bug 26705: Make Koha::Email->send_or_die handle Bcc

Koha used to rely on Mail::Sendmail for sending emails. As an SMTP
client, the library took the job of extracting Bcc headers (and removing
them) to pass them along with the recipients listed on To: and Cc: to
the SMTP protocol in the form of RCPT TO: lines. [1]

This was overlooked when we moved to Email::Stuffer/Email::Simple and
there's a different behavior, that is a design decision [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 {to} parameter is passed, it extracts the recipients
from the headers, as Mail::Sendmail does, and calls
$self->SUPER::send_or_die with the right parameters.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> FAIL: Bcc is not handled correctly!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! The recipients list is correct! No Bcc header
sent!
5. Sign off :-D

[1] https://metacpan.org/release/Mail-Sendmail/source/lib/Mail/Sendmail.pm#L331
[2]
https://metacpan.org/pod/Email::Sender::Manual::QuickStart#Hey,-where's-my-Bcc-support

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

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


More information about the Koha-bugs mailing list