Bug 28019 - Script "process_message_queue.pl" no more accepting comma separated addresses
Summary: Script "process_message_queue.pl" no more accepting comma separated addresses
Status: RESOLVED DUPLICATE of bug 28870
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-22 18:54 UTC by Michael Kuhn
Modified: 2021-11-12 18:16 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Kuhn 2021-03-22 18:54:30 UTC
Since in the Koha staff client it is not possible to send the same e-mail to two recipients at once we have regularly updated field "message_queue.to_address" of pending messages by SQL to contain two addresses instead of one (e. g. "abc@def.com,xyz@def.com") and in Koha 19.11 script "process_message_queue.pl" sent these notices to both addresses without a problem. But after the update to Koha 20.11 this doesn't work anymore - instead the script says:

Invalid 'to' parameter: abc@def.com,xyz@def.comxxx: 11 status returned by "/usr/share/koha/bin/cronjobs/process_message_queue.pl"

In Bug 26706 Tomas Cohen Arazi wrote: "The non-advertised feature of accepting comma separated addresses is still not working. I can solve it on a separate bug report if someone files it. It needs to specify which fields could be multi-address."

I our case field "message_queue.to_address" did contain two comma separated addresses. According to http://schema.koha-community.org/20_11/tables/message_queue.html this is the only field that contains recipients.
Comment 1 Michael Kuhn 2021-03-22 19:01:31 UTC
Sorry, it was Bug 26705 not Bug 26706.
Comment 2 Tomás Cohen Arazi 2021-03-23 11:05:49 UTC
Ok, so this was some hack: you manually intercept the messages_queue unsent messages, and tweak the message_queue.to_address column.

Can you explain a bit more why aren't you using (say) NoticeBcc?
Comment 3 Michael Kuhn 2021-03-23 11:21:23 UTC
(In reply to Tomás Cohen Arazi from comment #2)
> Ok, so this was some hack: you manually intercept the messages_queue unsent
> messages, and tweak the message_queue.to_address column.
> 
> Can you explain a bit more why aren't you using (say) NoticeBcc?

The first address is the one the main user while the second address is either a second address of this same person (e. g. his home address) or the address of his secretary (which actually often cares about the checked-out media instead of the main user).

We do use system preference "NoticeBcc" but this contains another address - the head of the library (while at the moment in Koha 20.11 this also doesn't work, see Bug 26705) who needs to control what e-mails where sent out.
Comment 4 Tomás Cohen Arazi 2021-10-04 21:50:01 UTC
I found a case of passing --to with multiple addresses to runreports.pl that stopped working, and might be related.
Comment 5 Tomás Cohen Arazi 2021-11-12 18:16:15 UTC
This is actually fixed by bug 28870.

Tested on master with (a good SMTP config on koha-conf.xml and) this command:

$ perl misc/cronjobs/runreport.pl --to "tomascohen@gmail.com,nick@bywatersolutions.com,liz@bywatersolutions.com" --subject "Sending to tomascohen@gmail.com,nick@bywatersolutions.com,liz@bywatersolutions.com" --format html 1

*** This bug has been marked as a duplicate of bug 28870 ***