Created attachment 164987 [details] Screenshot of file deletion dialogue SUMMARY Sometimes when right clicking and saving an attachment in kmail, if you click then 'open file' option that appears in the Kmail dialogue, you can view / edit the file, but on closure Kmail sometimes deletes the file. Sometimes it will do so with a message giving you the choice to delete the file - which is unexpected and may lead to the wrong user choice - but also at least once it has seemed to delete the file on closure without any user input. STEPS TO REPRODUCE 1. Open a message in Kmail that has attachment(s), through a single click in the message list 2. Right click, save as on the attachment. Save to disk 3. Click open file in the dialogue that appears (which also allows an 'open folder' option). 4. Edit file, save/close 5. Kmail / Plasma sometimes presents a dialogue asking if you still wish to delete the 'supposedly temporary file', despite it having been manually saved to user folders. OBSERVED RESULT Kmail/KDE sometimes - but not always - presents a dialogue where the default option is to delete the edited file. EXPECTED RESULT Closure leaves file unchanged, as it has been saved by the user. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Debian 12, Kernel version - 6.1.0-17-amd64 KDE Plasma Version: 5.27.5 KDE Frameworks Version: 5.103.0 Qt Version: 5.15.8 ADDITIONAL INFORMATION This bug does not appear on every attempt but has been observed a number of times and carries a risk of data loss.
This appears to be due to this[0] line in messagelib, where opened files are unconditionally deleted. [0] https://invent.kde.org/pim/messagelib/-/blob/master/messageviewer/src/widgets/opensavedfilefolderwidget.cpp?ref_type=heads#L75