I expected the following command line should open a mail with a two line body: kmail "mailto:?to=test@test.com&subject=test&body=line1%0D%0Aline2" However the line break doesn't work. Reproducible: Always Steps to Reproduce: 1. Open terminal 2. Run kmail "mailto:?to=test@test.com&subject=test&body=line1%0D%0Aline2" 3. Check if the expected line break is missing Actual Results: No line break between line1 and line2 Expected Results: Line break between line1 and line2 Kubuntu 16.04.
An different users reported that the command line works with KMail 4.14.2.
My apologies, I accidentally selected this bug while deleting a lot of spam. Restoring data...
I'm also affected by this bug. I think I found the cause for this, and if so it should be easy to fix. KMail uses MessageCore::StringUtil::parseMailtoUrl[1] to parse url query parameters. In parseMailtoUrl it uses QUrlQuery::queryItems() to get the list of parameters. By default queryItems does not decode all "%" elements.[2] So using QUrlQuery::queryItems(QUrl::FullyDecoded) instead should fix this. I think the explicit "%0A" to "\n" transformation in Lines 197-202 would than be obsolete as well. [1] Especially since mailto urls must have "%0D%0A" and not "%0A" line breaks. [3] [1] Line 185: https://quickgit.kde.org/?p=messagelib.git&a=blob&h=41d01b75b9058281ac9f5bdd4e4abea0c34b309a&hb=0c5e64ed193141edd63de7eb01a10e6d353e1856&f=messagecore%2Fsrc%2Futils%2Fstringutil.cpp [2] http://doc.qt.io/qt-5/qurl.html#ComponentFormattingOption-enum [3] RFC2368 Section 5: http://www.ietf.org/rfc/rfc2368.txt
Git commit c5cd3c5129a1b8a33da894eaadb79b461e45c3cc by Montel Laurent. Committed on 21/08/2016 at 07:20. Pushed by mlaurent into branch 'Applications/16.08'. Fix Bug 366981 - Mailto URL does not allows a body with line breaks FIXED-IN: 5.3.1 M +11 -0 messagecore/autotests/stringutiltest.cpp M +1 -0 messagecore/autotests/stringutiltest.h M +1 -3 messagecore/src/utils/stringutil.cpp http://commits.kde.org/messagelib/c5cd3c5129a1b8a33da894eaadb79b461e45c3cc
Thanks Montel. But the `if (!body.isEmpty()) { [...] }` does now nothing: body comes from values and gets inserted into values (with the same key).