Bug 505898

Summary: Modify the temp folder of attachements from /tmp to /tmp/kmail
Product: [Applications] kmail2 Reporter: Alexandre Bonneau <alexandre.bonneau>
Component: generalAssignee: kdepim bugs <pim-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version First Reported In: 6.3.3   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Alexandre Bonneau 2025-06-21 07:52:28 UTC
SUMMARY
Currently, when opening temporary files from any emails, the attachement is saved in `/tmp/messageviewer_attachement_<code>`.
After a moment, the /tmp folder can display quite a lot of those folders.

STEPS TO REPRODUCE
1. Just use Kmail and open a few mail with attachements
2. Check the /tmp folder

OBSERVED RESULT
Lots of `/tmp/messageviewer_attachement_<code>` folders displayed

EXPECTED RESULT
It would be more 'clean' to create all those temporary folder inside `/tmp/kmail/messageviewer_attachement_<code>`, so that when browsing /tmp you do not see a wall of temp folders

SOFTWARE/OS VERSIONS
KDE Plasma Version: 4:6.3.5-1
Comment 1 Laurent Montel 2025-09-02 11:53:46 UTC
Git commit 1edf5bd4278904b7d82a03ab6f7e4b7adb8e5c4d by Laurent Montel.
Committed on 02/09/2025 at 11:53.
Pushed by mlaurent into branch 'master'.

Fix 505898: Modify the temp folder of attachements from /tmp to /tmp/kmail

M  +2    -1    messageviewer/src/htmlwriter/webengineparthtmlwriter.cpp
M  +2    -1    messageviewer/src/viewer/viewer_p.cpp
M  +2    -1    mimetreeparser/src/nodehelper.cpp

https://invent.kde.org/pim/messagelib/-/commit/1edf5bd4278904b7d82a03ab6f7e4b7adb8e5c4d