[Bug 37918] New: Properly encode email subjects in mailto: links
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Bug ID: 37918 Summary: Properly encode email subjects in mailto: links Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org There are some places in Koha where we use mailto: links with a subject line. An example is the email link added by bug 36595. I believe we need to take a closer look at making sure we are encoding the subject line correctly. Also need to make sure to not include untranslatable and therefore hardcoded bits into the subject messages. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36595 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- So, on my quick research I reckon we need a new TT filter to make sure subjects are properly RFC2047 encoded. We should be able to add that fairly trivially using Encode::MIME::Header I think. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 171518 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171518&action=edit Bug 37918: Add email_header template toolkit filter This patch adds a new email_header TT filter to properly encode strings according to RFC2047 as per the email specification. This allows developers to set default subjects in mailto links with the correct encoding. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Shi Yao Wang <shi-yao.wang@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171518|0 |1 is obsolete| | --- Comment #3 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- Created attachment 171994 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171994&action=edit Bug 37918: Add email_header template toolkit filter This patch adds a new email_header TT filter to properly encode strings according to RFC2047 as per the email specification. This allows developers to set default subjects in mailto links with the correct encoding. Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Shi Yao Wang <shi-yao.wang@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |shi-yao.wang@inLibro.com --- Comment #4 from Shi Yao Wang <shi-yao.wang@inLibro.com> --- Assuming I only needed to make sure the test passes for the sign-off. Should we include refactoring of mailto with subject in this bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Yes indeed, that was the next step here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 176576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176576&action=edit Bug 37918: Remove the new dependency -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- Do we really need the new dep? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- 24 use Encode::MIME::Header; but you are not using it? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #9 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Would PQA this, if it weren't for these 2 lines:
Should we include refactoring of mailto with subject in this bug? Yes indeed, that was the next step here.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |paul.derscheid@lmscloud.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #8)
24 use Encode::MIME::Header;
but you are not using it?
That module is what adds the 'MIME-Header' support to 'encode'.. without it we're not encoding in MIME-Header format... see line 55 of the patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- If someone wants to follow-up here and apply the filter to all the current email subjects that would be great.. I'm unlikely to have a chance to continue here myself any time soon. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #12 from Paul Derscheid <paul.derscheid@lmscloud.de> --- So should we change the bug description and scope this bug to the filter itself? Then we at least have it. Also quickly looked again at: https://metacpan.org/pod/Encode::MIME::Header I don't like it when libraries work that way, but it is what it is. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #13 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 176869 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176869&action=edit Bug 37918: Add filter to existing email subjects -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171994|0 |1 is obsolete| | --- Comment #14 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 176870 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176870&action=edit Bug 37918: Add email_header template toolkit filter This patch adds a new email_header TT filter to properly encode strings according to RFC2047 as per the email specification. This allows developers to set default subjects in mailto links with the correct encoding. Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176576|0 |1 is obsolete| | --- Comment #15 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 176871 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176871&action=edit Bug 37918: Remove the new dependency Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #16 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Sent a keyboard interrupt by accident.. Fixing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Hopefully that's all the cases covered.. must admit, I've not actually tested that last patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176870|0 |1 is obsolete| | --- Comment #18 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 176873 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176873&action=edit Bug 37918: Add email_header template toolkit filter This patch adds a new email_header TT filter to properly encode strings according to RFC2047 as per the email specification. This allows developers to set default subjects in mailto links with the correct encoding. Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176871|0 |1 is obsolete| | --- Comment #19 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 176874 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176874&action=edit Bug 37918: Remove the new dependency Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176869|0 |1 is obsolete| | --- Comment #20 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 176875 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176875&action=edit Bug 37918: Add filter to existing email subjects Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Failed QA --- Comment #21 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This patch set raises a few questions: [1] How is [% something | email_header %] supposed to work? Where does email_header link to the EmailHeader module? I think this just returns nothing. I would expect [% something| $EmailHeader %] Since this was tested by two people, please explain. (No test plan in the third patch.) [2] Are you sure that you are doing the right thing here? We are in an HTML context, not working with email headers directly but representing them in html. Please clarify. Why =?UTF-8?B?SGVsbG8gV29ybGQ=?= instead of Hello%20World for instance? Should the script sending a mail subject to the html template be responsible? [3] How do you prevent double encoding? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|paul.derscheid@lmscloud.de |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #22 from Paul Derscheid <paul.derscheid@lmscloud.de> --- You are correct Marcel, I was careless especially with that last patch. I had a conversation with Martin during QA and didn't run the qa script when quickly signing off that last patch (which would've caught the incorrect usage). Thanks for catching my mistake. In regard to the reasoning: 1) Since the tests passed (and there was no usage at that point during QA), I didn't even look at the usage in the POD. You are correct, the correct usage should be [% something | $EmailHeader %]. 2) This needs further investigation, I can't even reproduce the root issue that this bug was about with unfiltered korean. 3) Valid concern. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #23 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 177103 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177103&action=edit Bug 37918: Correct POD -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #24 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 177104 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177104&action=edit Bug 37918: Correct usage -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #25 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Here's at least the usage corrected, but it would be nice to see a failing example. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|martin.renvoize@ptfs-europe |oleonard@myacpl.org |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #26 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- I honestly don't know the answer to your questions and it's not a problem in the UK was we rarely have non-ascii subjects being generated.. I wrote this patch at Katrins request as a follow-up to another bug. I researched and came to the conclusion that mailto's just pass the header parameters directly so this was the right thing to do and not HTML escaping as we're not talking about HTML we're talking about an email header. As for the use of the plugin, I just followed existing examples in the codebase and there's unit tests to cover the new plugin too. Stepping out as I'm juggling too many bugs already. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 --- Comment #27 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- I'm resetting the assignee here.. I did my best but if the original people requesting the work don't test and contribute there's little I can do to follow-up. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37918 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|martin.renvoize@openfifth.c |oleonard@myacpl.org |o.uk | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org