Bug 24826 - Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm
Summary: Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/p...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All Linux
: P5 - low trivial (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 27084 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-03-08 06:58 UTC by mjnkml
Modified: 2022-06-06 20:24 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11


Attachments
Bug 24826: Remove warnings from Sendmail (992 bytes, patch)
2020-03-11 15:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24826: Remove warnings from Sendmail (1.03 KB, patch)
2020-04-08 08:28 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description mjnkml 2020-03-08 06:58:12 UTC
In my cron email for Cron <root@koha> koha-foreach --chdir --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl:


Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 253.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 254.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 544, <S> chunk 16.
Use of uninitialized value $mail{"Cc"} in concatenation (.) or string at /usr/share/perl5/Mail/Sendmail.pm line 545, <S> chunk 16.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 253.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 254.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 544, <S> chunk 16.
Use of uninitialized value $mail{"Cc"} in concatenation (.) or string at /usr/share/perl5/Mail/Sendmail.pm line 545, <S> chunk 16.
U
.
.
.
Comment 1 Jonathan Druart 2020-03-11 15:21:49 UTC
Created attachment 100579 [details] [review]
Bug 24826: Remove warnings from Sendmail

Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm

This is just a guess, I did not try this patch.
Comment 2 Jonathan Druart 2020-03-11 15:22:36 UTC
Hi, are you able to test this patch?

I do not have Sendmail configured in my test environment so cannot recreate the problem.
Comment 3 mjnkml 2020-03-13 14:23:22 UTC
(In reply to Jonathan Druart from comment #2)
> Hi, are you able to test this patch?
> 
> I do not have Sendmail configured in my test environment so cannot recreate
> the problem.

Hi,

Just to clarify: I'm using postfix.

The patch seems to work really well. Some output:

before patching:

$ sudo koha-foreach --chdir --enabled --email /usr/share/koha/bin/cronjobs/overdue_notices_borrower_1_only.pl -t
$ sudo koha-foreach --chdir --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl -v
sending email message to patron: 1 at /usr/share/koha/lib/C4/Letters.pm line 980.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 253.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 254.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 544, <S> chunk 16.
Use of uninitialized value $mail{"Cc"} in concatenation (.) or string at /usr/share/perl5/Mail/Sendmail.pm line 545, <S> chunk 16.
sending email message to patron: 1 at /usr/share/koha/lib/C4/Letters.pm line 980.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 253.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 254.
Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm line 544, <S> chunk 16.
Use of uninitialized value $mail{"Cc"} in concatenation (.) or string at /usr/share/perl5/Mail/Sendmail.pm line 545, <S> chunk 16.
$

after patching:


$ sudo koha-foreach --chdir --enabled --email /usr/share/koha/bin/cronjobs/overdue_notices_borrower_1_only.pl -t
$ sudo koha-foreach --chdir --enabled --email /usr/share/koha/bin/cronjobs/process_message_queue.pl -v
sending email message to patron: 1 at /usr/share/koha/lib/C4/Letters.pm line 980.
sending email message to patron: 1 at /usr/share/koha/lib/C4/Letters.pm line 980.
$
Comment 4 Jonathan Druart 2020-03-16 12:04:23 UTC
Could you attach a signed-off patch?
Comment 5 Martin Renvoize 2020-04-08 08:28:31 UTC
Created attachment 102534 [details] [review]
Bug 24826: Remove warnings from Sendmail

Use of uninitialized value $mail{"Cc"} in substitution (s///) at /usr/share/perl5/Mail/Sendmail.pm

This is just a guess, I did not try this patch.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-04-08 08:29:21 UTC
Taking mjnkml@gmail.com as the SO and passing QA as this is a trivial and clear fix.
Comment 7 Martin Renvoize 2020-04-08 10:55:23 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Joy Nelson 2020-05-01 18:58:47 UTC
backported to 19.11.x for 19.11.06
Comment 9 Lucas Gass 2020-05-11 21:49:07 UTC
backported to 19.05.x for 19.05.11
Comment 10 Jonathan Druart 2020-11-25 10:50:29 UTC
*** Bug 27084 has been marked as a duplicate of this bug. ***
Comment 11 David Cook 2020-12-11 00:23:04 UTC
*** Bug 27084 has been marked as a duplicate of this bug. ***