When typing a name you can get multiple results, that only differ in the quoutes they have: John Doe <doe@example.com> "John Doe" <doe@example.com> "'John Doe'" <doe@example.com> This is annoying and some versions are not allowed by RFC 2822. The bug should be either fixed in AddresseeLineEdit::addContact [kdepim]/libkdepim/addressline/addresslineedit or KPIMUtils::normalizedAddress [kdepimlibs]/kpimutils/email. relevant part of the RFC 2822: to = "To:" address-list CRLF address-list = (address *("," address)) / obs-addr-list address = mailbox / group mailbox = name-addr / addr-spec name-addr = [display-name] angle-addr angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr display-name = phrase phrase = 1*word / obs-phrase word = atom / quoted-string atom = [CFWS] 1*atext [CFWS] atext = ALPHA / DIGIT / ; Any character except controls, "!" / "#" / ; SP, and specials. "$" / "%" / ; Used for atoms "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~" quoted-string = [CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS] qcontent = qtext / quoted-pair qtext = NO-WS-CTL / ; Non white space controls %d33 / ; The rest of the US-ASCII %d35-91 / ; characters not including "\" %d93-126 ; or the quote character quoted-pair = ("\" text) / obs-qp text = %d1-9 / ; Characters excluding CR and LF %d11 / %d12 / %d14-127 / obs-text obs-qp = "\" (%d0-127) obs-text = *LF *CR *(obs-char *LF *CR) obs-char = %d0-9 / %d11 / ; %d0-127 except CR and %d12 / %d14-127 ; LF Reproducible: Always Steps to Reproduce: 1. enter a name "Doe" 2. get mutliple results (from baloo) Expected Results: only one valid result. The bug #316036 is about different versions writing an email address. This one here cares about RFC and quotes.
Note that the problem is not necessarily that multiple entires are shown (as covered by 316036), but rather that entires make it into the selection that are not actually valid email addresses, causing the email to be rejected by the server. One reason is possibly faulty indexing of the addresses, perhaps there are others. In any case it probably would make sense to ensure a selected email address is valid before copying into the mail, or even hiding it completely from the selection. From the rfc excerpt I take a name has to be quoted if it contains spaces, otherwise not. So valid would be: "John Doe" <john@doe.com> John <john@doe.com>
Created attachment 90368 [details] patch from the kolab branch
Well at least I have created a patch, so actually if someone wants to take care to get it into- feel free. Otherwise it will come into kdepim if other patches from kolab will enter kdepim.
Git commit 84a0945c2e0c00de317de50e7f0c9e0156d08071 by Montel Laurent. Committed on 04/02/2015 at 08:33. Pushed by mlaurent into branch 'KDE/4.14'. Fix Bug 336163 - autocompletion shows multiple entries for one contact with different quotes Adapt patch from Sandro Knauß to new baloocompletionemail class + unittest etc. FIXED-IN: 14.12.3 M +1 -1 libkdepim/addressline/autotests/CMakeLists.txt M +10 -0 libkdepim/addressline/autotests/baloocompletionemailtest.cpp M +1 -0 libkdepim/addressline/autotests/baloocompletionemailtest.h M +40 -3 libkdepim/addressline/baloocompletionemail.cpp M +2 -1 libkdepim/addressline/baloocompletionemail.h http://commits.kde.org/kdepim/84a0945c2e0c00de317de50e7f0c9e0156d08071