Bug 439064

Summary: filter created on To wrongly matches also Delivered-To
Product: [Applications] kmail2 Reporter: kavol <kavol>
Component: commands and actionsAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description kavol 2021-06-23 11:15:31 UTC
I'm receiving lots of emails that are not directed to me, yet I want to process them somehow. For some purposes, I need to filter out email where I am not on the list of recipients. Trying to make negative filter on "To" with my address fails, because the filter rules wrongly matches "Delivered-To".

STEPS TO REPRODUCE
1. have your address subscribed somewhere from where you get some emails with your address in "To:" field and some sent to BCC or so, with your address not included in "To:" but included in "Delivered-To:"
2. create an filter in kmail with a rule "To:" "does not contain" "youraddress@example.com"
3. apply the filter on a message which does not contain your address in "To" (but it is present in "Delivered-To")

OBSERVED RESULT
the message is not matched, the filter action is ignored

EXPECTED RESULT
the message is matched and the filter action performed on it

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 34
(available in About System)
KDE Plasma Version: 5.22.1
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
kmail-20.12.2-1.fc34.x86_64

ADDITIONAL INFORMATION
also Envelope-To might suffer from the same, but I haven't tested it