Bug 377150

Summary: Use real attachment's file name when opening an attachment
Product: [Applications] kmail2 Reporter: Geert Janssens <info>
Component: commands and actionsAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: andy
Priority: NOR    
Version: 5.3.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Geert Janssens 2017-03-03 08:57:22 UTC
When opening an attachment directly from the mail, it is saved to /tmp first with a name like "messageviewer_<randomid>.pdf", and so that's the name that also will be used by the application opening the attachment.

This behaviour has changed recently. Before the temporary name was the actual name of the attachment, optionally with a number appended to it if the original name already existed in the tmp folder.

The new behaviour is rather inconvenient because the file name often has meaning. Some examples of the issues this generic naming brings with it:

- the name of the attachment you see in the e-mail has no link any more with the name of the file that is open. So it's hard to link back the open file to an e-mail. This gets more increasingly hard as you open more attachments from different e-mails.

- when opening multiple attachments it is no longer evident from the taskbar which file is which because they are all named 'messageviewer_xyz.ext' Switching files from the taskbar after several are open has become a hit and miss.

- when you have opened an attachment, you may decide to resave it (to a location other than tmp) directly from the application that is used to open the attachment (libreoffice or okular for example). You typically do this by using "Save as". However the proposed name in that dialog is now 'messageviewer_xyz.ext' rather than the much more descriptive name the attachment originally had in the mail.
Comment 1 Andy Goss 2017-03-04 05:11:21 UTC
I confirm this, it applies at least to PDF files, plus .doc and .odt files created by Libre Office.

In addition, on Wednesday I received a .doc attachment that Libre Office opened with a filename of "untitled 1". And it still does today (as do .doc/.odt attachments to older emails), when attachments sent today open as "messageviewer_<*>" 

As far back as I can go PDF files want to save as "messageviewer_<*>".
Comment 2 Geert Janssens 2018-10-01 09:23:14 UTC
I'm not seeing this issue any more with more recent versions of KMail (currently running 5.7.3). So as far as I'm concerned this bug is now fixed.
Comment 3 Christophe Marin 2018-10-01 12:31:38 UTC
Thanks for keeping us informed.