Bug 249157 - kmail --composer fails to parse some mailto lines
Summary: kmail --composer fails to parse some mailto lines
Alias: None
Product: kdepimlibs
Classification: Applications
Component: kmime (show other bugs)
Version: 4.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
Depends on:
Reported: 2010-08-27 01:03 UTC by Jonas Thorell
Modified: 2017-01-07 22:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:

KAddressBook Version 4.6 pre (4.6 Beta1) (42.66 KB, image/png)
2010-12-06 11:58 UTC, Hans-Rudi Denzler
kaddressbook krunner kmail --composer (122.45 KB, image/png)
2010-12-08 14:29 UTC, Hans-Rudi Denzler

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Thorell 2010-08-27 01:03:51 UTC
Version:           unspecified (using KDE 4.5.0) 
OS:                Linux

Details first: I'm running KDE SC 4.5.0 with the 4.4.5 version of Kontact. Some of my contacts in the address-book (in their names but not the e-mail addresses) uses characters specific to the Swedish language (Å, Ä, or Ö). 

That's usually not a problem. If I start a new "Composer" window from within Kmail and start typing the name of the contact in the "To:" field (say a name like Göran, a not uncommon Swedish first name) Kmail shows all contacts with that name as possible recipients (and displays it as it should).

However, if I bring up the krunner interface and types the same thing the following happens:

The krunner interface shows a result of (for example): "Mail to Göran Andersson". Which it should. 

But in the composer window that's opened up it says:

"G?ran Andersson" <e-mail@isp.com>"

That is, the Swedish character is replaced with a question-mark.

Now, I'm not sure if this is a krunner problem, an akonadi one, or a problem with combining KDE SC 4.5.0 with the Kontact version of 4.4.5. It seems unlikely to be a locale problem though, since if it was: shouldn't it occur even when the auto-complete feature of Kmail is used?

Reproducible: Always
Comment 1 Hans-Rudi Denzler 2010-08-27 15:45:19 UTC
I'm using openSUSE 11.2 (i586), KDE 4.5.0, German. All kdepim apps are in English only. No German translation yet: e.g. kmail-4.4.5-236.4.i586, kmail.mo is missing.
The "G?ran"-problem was solved in late KDE 4.4:
Test cases for KAddressBook:
a ü -a
a ü-a
ü -a
These test cases produce "?", but passed in late KDE 4.4.
Comment 2 Hans-Rudi Denzler 2010-08-27 19:56:56 UTC
See bug 226984
Comment 3 Jonas Thorell 2010-08-28 01:15:28 UTC
(In reply to comment #1)

> These test cases produce "?", but passed in late KDE 4.4.

Well, here they don't. I added some contacts to my adressbook using those characters and I get the ? problem for those as well. Note: ONLY when I'm using the krunner contacts plugin to compose a new message. 

And the only difference in my setup compared to yours is the version of openSUSE in use (I'm using 11.3, with the KDE factory repos to get 4.5.0). I'm only using the English translations as well.
Comment 4 Hans-Rudi Denzler 2010-08-28 12:58:00 UTC
> Note: ONLY when I'm using the krunner contacts plugin to compose a new message.

If I click the Email-address of a test case in KAddressBook the behaviour is same as in the krunner contacts plugin --> "?" instead of an ü.
Comment 5 Matthias Fuchs 2010-12-05 22:44:25 UTC
I just tried with trunk (what will become 4.6) and it works there. Could you please try with a newer version -- I guess 4.6 beta 2 should work -- and see if the problem still exists there?
Comment 6 Hans-Rudi Denzler 2010-12-06 11:58:58 UTC
Created attachment 54199 [details]
KAddressBook Version 4.6 pre (4.6 Beta1)

Internet Email is set but doesn't appear to the right above 'Address Book ...' yet. Cannot verify...
Comment 7 Matthias Fuchs 2010-12-08 13:01:06 UTC
So do you mean that you still get the "?" when searching for entries in the adress book via krunner?
Comment 8 Hans-Rudi Denzler 2010-12-08 14:29:56 UTC
Created attachment 54299 [details]
kaddressbook krunner kmail --composer

There are 4 entries instead of 2 with 'a ü'. With entries 1+2 ('a ü-a') the 'To:/An:'-field is empty. With entries 3+4 ('a ü -a') the 'To:'-field is not empty and correct.
Comment 9 Jonas Thorell 2010-12-09 00:18:02 UTC
(In reply to comment #5)
> I just tried with trunk (what will become 4.6) and it works there. Could you
> please try with a newer version -- I guess 4.6 beta 2 should work -- and see if
> the problem still exists there?

I hope I will be able to during the weekend. Still, is it a requirement to upgrade the PIM-suite as well or is it safe to keep that at version 4.4.8? If it's a requirement to upgrade Kontact as well as the rest, how safe is the migration? I have space to make a backup of the Kontact information, but what exactly needs to be backed up? Is it sufficient to copy .kde(4) to somewhere else or are there files/directories outside of that subtree that must be backed up in order to be able to fully roll-back if need be?
Comment 10 Matthias Fuchs 2010-12-11 01:49:34 UTC
Ok, this looks like either a problem in KToolInvocation::invokeMailer or a problem with the handling of the mailto protocol.

Using "a ü-a<2@test.com>" or "\"a ü-a\"<2@test.com>" as to-adress does not work, while "a ü-a <2@test.com>" works.

@Jonas you don't need to try, your specific problem should be solved, while not all of the cases mentioned in comment #1 work.
Comment 11 Matthias Fuchs 2010-12-11 12:30:33 UTC
Ok, after further investigation this turns out as KMail bug.
"kmail --composer -- mailto:\"a ü<test@test.com>\"" does not work
"kmail --composer -- mailto:\"a ü <test@test.com>\"" works
"kmail --composer -- mailto:\"a a<test@test.com>\"" works
Comment 12 Matthias Fuchs 2010-12-11 13:39:32 UTC
Damn, constant reasigning sucks. :D
Finally to me this looks like a problem in KMime.

The space indicated ("a a␣<test@test.com>") is not needed according according to RFC 822 A.2.3, though I wonder if this is also true for non-ASCII letters.
If it is this is a bug in parsing of KMime.
Comment 13 Matthias Fuchs 2010-12-12 13:17:50 UTC
SVN commit 1205751 by mfuchs:

Works around BUG:249157 by using the form "NAME <EMAIL>" instead of "NAME<EMAIL>".
The first version is perfectly valid, the second that does not always work [1] might also be valid.

[1] Fails e.g. for NAME="a ü-a" or "ü-a"


 M  +1 -1      contactsrunner.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1205751
Comment 14 Denis Kurz 2016-09-24 20:56:19 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kdepim (version 5.0 or later, as part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 15 Denis Kurz 2017-01-07 22:30:15 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.