Bug 315319 - kmail 4.9.5 filter "not in addressbook" does not read the whole address book
Summary: kmail 4.9.5 filter "not in addressbook" does not read the whole address book
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.9.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-17 13:53 UTC by Christian
Modified: 2017-01-07 21:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian 2013-02-17 13:53:04 UTC
I have set a filter to "From" "is not in addressbook". It acts on some messages that it should not act on. E.g. the filter log shows something like this:
[12:10:26] Suoritetaan suodatussääntöjä:(match all of the following) "<status>" <contains-not> "Spam" "From" <is-not-in-addressbook> "is not in address book"
[12:10:26] 1 = "<status>" <contains-not> "Spam"
[12:10:26] 1 = "From" <is-not-in-addressbook> "is not in address book" (Somebody's name <some.bodys@email.address>)
[12:10:26] Suodatussäännöissä on osumia.
[12:10:26] Applying filter action: Add to Address Book "From 53 "

Then it tries to add the email address (which was already in the address book) and I get a popup saying that, because the email address is already in the addressbook, I should consider exporting it as a vcard and importing it again. (No idea what that's about, I just click OK as there is no other button.) Afterwards, I have two contacts in the addressbook with the same email address. (The old one and the one added by the filter.) If I get another email by the same From address, then a third contact is created etc.
It only happens sometimes. I'm trying to figure out if it is specific to the account that receives the message, or does it have to do with whether the contact's email address is stored in the address book as "primary" or "additional", or if there is any other obvious pattern to this...

Reproducible: Sometimes
Comment 1 Christian 2013-02-17 19:44:11 UTC
So far the best explanation I can come up with is that, for the filter condition to consider something "in the address book", both the email address as well as the name string in front of the email address have to match. E.g. An address book entry: Lucky Luke <lucky.luke@wild.west> would match the following "From:" lines:
From: Lucky Luke <lucky.luke@wild.west>
From: Luke Lucky <lucky.luke@wild.west>
But it would not match something like:
From: Professor Lucky Luke <lucky.luke@wild.west>

I think it's a bug or in any case it's undocumented and unexpected. Can somebody confirm that my hunch of what's going on is accurate?
Comment 2 Christian 2013-02-18 19:34:05 UTC
...for some addresses, it does even stranger things. E.g. I received an email with CC to (changing the name here, but something like) Cc: James.TheSecond@Good-Old.England - the Email address is in my addressbook. The filter automatically added a new contact with just the name TheSecond and nothing else.
Comment 3 Christian 2013-02-19 05:59:21 UTC
Another observation on the cases when the filter adds a new contact with only a name, not an email address. This seems to happen when the "Display name" in the email shows with a comma. E.g., if the following is not in the address book, two contacts are added.
(Email:)
To: "Miller, Mike [KING] <mike.miller@king.royalty.org>" <mike.miller@king.royalty.org>
(Address book:)
-> Adds one contact: Mike [KING] with email address as above
-> Adds another contact: Miller with nothing else

I think this should have added one contact with the email address and then everything else as the name. (Maybe the email address for that new contact should be shown in the name as well, because according to that To: string the name is "Miller, Mike [KING] <mike.miller@king.royalty.org>".
Comment 4 Christian 2013-02-19 20:11:18 UTC
Another observation: The filter considers two addresses as distinct, when they differ only in capitalisation. These should not be distinct.
E.g. Aku.Ankka@ankkalinna.fi is treated as not in the addressbook, when aku.ankka@ankkalinna.fi is contained in the addressbook.
Comment 5 Denis Kurz 2016-09-24 18:04:02 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 kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 6 Denis Kurz 2017-01-07 21:24:24 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.