Main Koha release repository https://koha-community.org
Find a file
Tomas Cohen Arazi bbd700ce0b Bug 29330: Restore handling of serialized MIME messages in message_queue
This patch changes how multipart MIME messages are handled on the
message_queue table.

The email, with the required attachments, is now generated using
Koha::Email, and serialized using Koha::Email->as_string.

This bug also adds Koha::Email->new_from_string which is used to read
that data from the DB, and produce a Koha::Email object, that can be
further augmented/modified using regular Koha::Email methods.

This implementation should be considered a middle ground, with
backportability in mind. higher-level methods should encapsulate setting
the default headers and addresses, to clean the area a bit further.

Preparation:
- You need a valid SMTP configuration in koha-conf.xml. If you use Gmail
  you can generate an 'app password' and set things like this:

 <smtp_server>
    <host>smtp.gmail.com</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>youraddress@gmail.com</user_name>
    <password>youpassword</password>
    <debug>1</debug>
 </smtp_server>
- Set KohaAdminAddress to your address.

To test:
1. Pick a patron. Make sure it doesn't have any email address (Acevedo?)
2. Set an overdue notice trigger for its category
3. Check something out, with due date in the past to force an overdue
4. Run:
   $ kshell
  k$ misc/cronjobs/overdue_notices.pl -v
  k$ exit
   $ koha-mysql kohadev
   > SELECT * FROM message_queue WHERE borrowernumber=the_borrowernumber;
=> SUCCESS: A notice has been created
5. Run:
   $ kshell
  k$ misc/cronjobs/process_message_queue.pl --verbose
=> SUCCESS: SMTP is ok => Email is sent
=> FAIL: Your inbox shows an email with weird content
6. Apply this patches
7. Run:
   $ koha-mysql kohadev
   > DELETE FROM message_queue;
8. Repeat 4 and 5
=> SUCCESS: You got an email with an attachment!
=> SUCCESS: The attachment contains an email that couldn't be delivered!
9. Try all the things that enqueue messages :-D
=> SUCCESS: No behavior change
10. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Edited the POD, restoring a few lines that describe the needed hash
keys of the attachments.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-15 12:38:39 +01:00
acqui Bug 29283: (QA follow-up) Remove code duplication 2021-11-02 14:57:09 +01:00
admin Bug 29429: (bug 17600 follow-up) Fix import in aqbudgetperiods.pl 2021-11-08 12:11:44 +01:00
api Bug 27360: Use 'public' to filter libraries for opac display 2021-11-03 15:40:52 +01:00
authorities
basket Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
bin
C4 Bug 29330: Restore handling of serialized MIME messages in message_queue 2021-11-15 12:38:39 +01:00
catalogue Bug 28959: (QA follow-up) One more lost 'category' to 'public' change 2021-11-02 14:27:12 +01:00
cataloguing Bug 29369: Use Flatpickr in dateaccessioned cataloging plugin 2021-11-03 15:40:53 +01:00
circ Bug 29015: Add options for itemtype, collection, and shelving location to view_holdsqueue.pl 2021-11-03 15:40:52 +01:00
clubs
course_reserves
debian
docs Bug 28904: Fix typo and display 2021-11-02 16:50:01 +01:00
errors
etc Bug 28236: Allow access to json files from apache config 2021-11-03 15:40:52 +01:00
ill
installer Bug 27360: (follow-up) DBRev 21.06.00.041 2021-11-15 12:38:39 +01:00
Koha Bug 29330: Add Koha::Email->new_from_string 2021-11-15 12:38:39 +01:00
koha-tmpl Bug 29459: Replace some missed datetimepickers in circulation templates with Flatpickr 2021-11-15 12:38:39 +01:00
labels
lib/CGI/Session/Serialize
members
misc Bug 28474: Pass process_message_queue.pl params to before_send_messages plugin hooks 2021-11-03 15:40:52 +01:00
offline_circ Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
opac Bug 29435: include missing subroutine from C4::AuthoritiesMarc 2021-11-15 12:38:39 +01:00
patron_lists Bug 16446: Add ability to add patrons to list by borrowernumber 2021-10-21 12:24:04 +02:00
patroncards Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
plugins
pos Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
reports Bug 17600: Fix imports for GetClassSources in guided_reports.pl 2021-11-02 14:27:48 +01:00
reserve
reviews
rotating_collections
serials Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
services
skel Bug 11078: Add locking to rebuild_zebra 2014-02-28 22:21:41 +00:00
suggestion Bug 24370: Allow resetting library to ANY 2021-11-02 14:57:04 +01:00
svc Bug 28959: Add virtualshelves.public as a boolean 2021-10-28 17:47:38 +02:00
t Bug 29330: Add Koha::Email->new_from_string 2021-11-15 12:38:39 +01:00
tags
tmp/modified_authorities
tools Bug 29380: Correct table name in joins to prevent errors 2021-11-03 15:40:52 +01:00
virtualshelves Bug 28959: Fix other cases 2021-10-28 17:47:38 +02:00
xt
.editorconfig Bug 27375: Set YAML file settings in .editorconfig 2021-11-03 15:40:52 +01:00
.eslintrc.json
.gitignore
.htaccess
.mailmap
.perlcriticrc
.proverc.dist Bug 19821: Install sample data, ES mappings and Version syspref 2021-10-25 11:27:40 +02:00
.scss-lint.yml Bug 21237: Clean up staff client SCSS 2018-08-24 16:23:25 +00:00
about.pl
app.psgi
changelanguage.pl
cpanfile Bug 28926: Update cpanfile for Mojolicious::Plugin::OpenAPI v2.16 2021-11-02 16:06:51 +01:00
fix-perl-path.PL Bug 28606: Remove $DEBUG and $ENV{DEBUG} 2021-06-24 11:53:44 +02:00
gulpfile.js
help.pl
INSTALL
Koha.pm Bug 24224: DBRev 21.06.00.046 2021-11-08 11:42:06 +01:00
koha_perl_deps.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
kohaversion.pl Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
LICENSE
mainpage.pl
Makefile.PL Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
MANIFEST.SKIP
package.json
README
README.md
README.robots
rewrite-config.PL
yarn.lock

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo