Bug 410483

Summary: Filter with custom headers doesn't match
Product: [Applications] kmail2 Reporter: Kamil <kamil.kuramshin>
Component: commands and actionsAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 5.11.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Kamil 2019-08-01 12:53:45 UTC
Want to create a filter to match some custom header in messages.
For example, X-MS-Exchange-Security - is a header inserted by Mail Server it has a specific value = beabed97-c8f6-4dff-a2a2-172912d88bc1. I have created a filter for this header:
"X-MS-Exchange-Security" <contains> "beabed97-c8f6-4dff-a2a2-172912d88bc1"
But it never match even if one apply it to specific message manually.
Same thing if filter looks like:
"<any header>" <contains> "beabed97-c8f6-4dff-a2a2-172912d88bc1"
And selected filter action is not performed.

Only if filter set to whole message it will start matching:
"<message>" <contains> "beabed97-c8f6-4dff-a2a2-172912d88bc1"

STEPS TO REPRODUCE
1. Create a filter with _custom header_ that should match specific string
2. Got a message with _custom header_ you want to filter by.
3. Apply filter to message from 2. 

OBSERVED RESULT
From filter journal:

[15:22:53] 0 = "<X-MS-Exchange-Security>" <contains> "beabed97-c8f6-4dff-a2a2-172912d88bc1" ()
[15:36:54] 0 = "<any header>" <contains> "beabed97-c8f6-4dff-a2a2-172912d88bc1"

EXPECTED RESULT
[15:22:53] 1 = "<X-MS-Exchange-Security>" <contains> "beabed97-c8f6-4dff-a2a2-172912d88bc1" ()
[15:36:54] 1 = "<any header>" <contains> "beabed97-c8f6-4dff-a2a2-172912d88bc1"
Filter should match and action should be executed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux 
KDE Plasma Version: plasma-desktop 5.16.4-1
KDE Frameworks Version: plasma-framework 5.60.0-1
Qt Version: qt5-base 5.13.0-7