Bug 455273

Summary: "From <end-with>" filter fails to identify sender when they also have a name
Product: [Applications] kmail2 Reporter: matthieu.malassis
Component: searchAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: montel
Priority: NOR    
Version: 5.20.2   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In: 5.21.0

Description matthieu.malassis 2022-06-14 20:14:27 UTC
SUMMARY
Setting up KMail as replacement for Thunderbird, i found out sender filters were inconsistently applied. After some testing, it appears the "From <end-with>" filter fails to identify a sender address when the sender also has a name. This might also apply to filters on other address fields, as well as <start-with>, <not-start-with> and <not-end-with> filters.

STEPS TO REPRODUCE
1. Configure a filter for matching the end of a sender address.
For instance: "From <end-with> @domain.com"
2. Create/Have an email whose sender is defined by address and by name.
For instance: "My friend <myFriend@domain.com>"
3. Apply the previous filter to the previous email.
- Filter log can be used to confirm whether and how the filter is applied.

OBSERVED RESULT
The filter fails to match sender address.

EXPECTED RESULT
The filter matches the sender address, whether the sender has a name or not.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro stable / KDE Plasma X11
(available in About System)
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.14.4 (compiled with 5.14.3)

ADDITIONAL INFORMATION
- If the filter is changed to match "From <end-with> @domain.com>", the filter matches
- If the filter is changed to match "From <contains> @domain.com", the filter matches
Comment 1 Laurent Montel 2022-06-15 04:50:35 UTC
So it's normal: end-with => search text at the end
=> if you have blo.com> => you need to search it.

So now I can adapt code for remove ">" first before searching.

I will do
Comment 2 Laurent Montel 2022-06-15 05:24:12 UTC
Git commit 15d84794c3b14326f7b9bacd49f5184a9ca90ce6 by Laurent Montel.
Committed on 15/06/2022 at 05:23.
Pushed by mlaurent into branch 'master'.

Fix 455273: "From <end-with>" filter fails to identify sender when they also have a name
FIXED-IN: 5.21.0

M  +14   -0    src/search/searchrule/searchrulestring.cpp

https://invent.kde.org/pim/mailcommon/commit/15d84794c3b14326f7b9bacd49f5184a9ca90ce6