Bug 507050

Summary: Mail Filter Message Tag Rules imported from Thunderbird results in message tag rules that get destroyed upon viewing them.
Product: [Applications] kmail2 Reporter: Gary Kenneth Krueger <garykennethkrueger>
Component: generalAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.24.5   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Gary Kenneth Krueger 2025-07-14 21:14:35 UTC
SUMMARY
Mail filter rules (containing Message tags) disappear when viewing filters imported from Thunderbird.  May be related to the fact that message tags in the rules get shifted to a different tag on import.  I had a special message tag, called "Downloaded" in the Thunderbird filter rules.  So, it may be necessary to include that one.

STEPS TO REPRODUCE
1. Do a fresh install of KDE.
2. In the process, import mail filters from Thunderbird that contain message tag rules.  I started with a rule for age greater than 14 days before the message tag rule(s) in each relevant filter.  I had set it for deleting messages.  You might want to choose something less destructive.  I was also using a user defined message tag "Downloaded" in the Thunderbird filters.
3. You may disable any or all of the filters from running in this process.  Whether they are turned on is not relevant to the issue.
4. Add one or more simple filters (such as age greater than 14 days) at the top of the list of filters.
5. Add 3 more filters with (age greater than 14 days is what I used) above all of the other filters.
6. Step through repeatedly looking at only the first 3 filters.  Nothing unexpected happens.
7. Step down to the imported filters with message tag rules.  It likely looks fine.
8. Move up and down to other imported filters above and below the filter in question, and back again.  You will find that the message tag rules begin to transform & disappear.
9. Move up to the 3 filters at the top that were created in KDE.  Step up and down between them.  You will now find that their filters begin to decay and disappear.

OBSERVED RESULT

Every time you move out and back into any of the affected rules, message tag rules transform and disappear.
Typically it transforms from something like "Downloaded" to "akonadi:?tag=2" (or something like that).

EXPECTED RESULT
Message tag rules that contain "Downloaded", "Important", "To Do", or whatever should not change to anything else when stepping through the list of filters, and shouldn't disappear.

SOFTWARE/OS VERSIONS
Kubuntu:  24.04 LTS
Kernel:  6.8.0.63-generic (64-bit)
Linux/KDE Plasma:
KDE Plasma Version:  5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Graphics Plaftorm:  X11

ADDITIONAL INFORMATION
Quitting KDE & Stopping Akonadi before going back into KDE doesn't make it any better.  Things are just as bad when you get back to looking at the filters.  And moving between them continues to destroy message tag rules.

Also, "akonadictl fsck" doesn't seem to resolve the issue.