Bug 502121

Summary: Sent-Mail Folders lost, reconfiguring them caused KMail to fail starting
Product: [Applications] kmail2 Reporter: Arek Guzinski <kermit>
Component: foldersAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: grave    
Priority: NOR    
Version First Reported In: 6.3.3   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Arek Guzinski 2025-03-28 11:25:17 UTC
SUMMARY
A few days ago I noticed that the local sent-mail folder was empty, except for one message from 3 weeks ago. There should have been a lot of older and a few newer mails as well.
I made a test by sending a mail to myself. Result: Mail arrives, but is not in sent-mail.
Yesterday I looked closer at the configuration and noticed that almost every sent-mail folder for every identidy was marked red. I reconfigured them all to the same path that was displayed (which should have been correct).
KMail seemed to work fine then (for receiving/reading mail - haven't tried sending)... 

Since rebooting, every time I try to start kmail, I get the following error message:
"The Email program encountered a fatal error and will terminate now.
The error was:
Could not create collection sent-mail, resourceId 4"

Then it terminates... (not a crash).



STEPS TO REPRODUCE
see above. I have no idea what the cause is.


ADDITIONAL INFORMATION
Operating System: KDE neon 6.3
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.11.0-21-generic (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-6500 CPU @ 3.20GHz
Memory: 15,5 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 GRE

May be connected to #436191
Comment 1 Arek Guzinski 2025-03-28 11:49:31 UTC
Edit/Additional info:
"almost every sent-mail folder"  --> What I meant is: the drafts and templates folders were shown red, too.

When browsing the local folders in akonadi console, the tree-view on the left tells me that there is 1 mail in outbox and 2 in sent-mail. When clicking on them however, the list on the right remains empty. (It works as expected for my non-local inboxes)
Comment 2 Arek Guzinski 2025-05-09 09:38:51 UTC
This is from memory, maybe 6 weeks ago, but I think this is what I did as a workaround (or at least something similiar):

I noticed that in ~/.local/share there were 2 directories:
akonadi_maildir_resource_0 akonadi_maildir_resource
so I did:

$ akonadictl stop
$ mv akonadi_maildir_resource_0 ~/Desktop
$ mv akonadi_maildir_resource akonadi_maildir_resource_0
$ akonadictl start

After this was working again (until now)