Bug 506133

Summary: Attachment saved to disk disappears after closing KMail
Product: [Applications] kmail2 Reporter: Hieu Van <hieu.van>
Component: commands and actionsAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Hieu Van 2025-06-25 02:04:24 UTC
SUMMARY
I recently encountered a relatively rare phenomenon: After saving an attachment to my specified folder, I attempted to open it with Okular and there was no problem. However after a few minutes (probably when I had just closed KMail), the file was gone without any trace. It was not in Trash. I also tried doing a /home-wide search and it was still nowhere to be found.

STEPS TO REPRODUCE
1. Save the attachment to a custom folder.
2. Open it (not sure if this is relevant).
3. Close KMail.

OBSERVED RESULT
The file is gone. It is not trashed, but deleted from disk.

EXPECTED RESULT
The file should have been there, precisely where it has just been saved.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian 13
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Although I have not digged deep into source code of KMail, I have observed that KMail keeps a temporary copy of the attachments. My theory is that when saving the attachment to disk, the final files might be copied from those temporary ones. Due to some reasons however, the reference to temporary files also got "redirected" to final saved files, thus causing them to be destroyed when KMail is closed.