Bug: Pid folders created when opening attachments - contains saved copies of files which used  'Open with' option.
Status: NEW
Priority: --
Created: 2022-05-15 13:10:13+00:00
Resolved: 2024-02-27 09:04:38+00:00

Windows 10 OS
After update possibly 91.6.0 (10th feb 2022) or 91.6.2 (8th March 2022), when I open attachments, a 'pid-xxxxx' folder is now being created in Users/User Name/Appdata/Local/Temp folder.
My oldest pid folder is dated 11th March 2022.
The 'pid-xxxxx' folder contains a copy of the actual attachment eg: *.jpg, *.mov, *.pdf,  *.xlxs, invite.ics etc
The 'pid-xxxxx' number corresponds to the program thunderbird.exe
If I open an attachment more than once, then a duplicate is created eg: *(1).jpg is created in same pid-xxxxx folder.

In prefs 'browser.helperApps.deleteTempFileOnExit' is set as true

Result is I have a lot of 'pid-xxxxx' folders which are not removed by Thunderbird upon exit.  They are consuming quite a lot of space as they are not .tmp files; they are full copies of the opened attachments as if they have been 'saved'. I am not selecting to save these files - just using the 'Open with' preset option.

I notice the following information in release notes which may or may not be related.
91.6.0
Fixed: Attachments filenames were not sanitized before saving to disk

91.6.2
Fixed: Temporary files from opened attachments were saved with world-readable permission

Another user also reports the same issue and also reports the opened files are not editable (opening in read-only mode - expected) but those opened read-only files no longer have any option to select to edit.

I have discovered that if I access the 'pid-xxxxx' folder and open one of the *.jpg files the 'rotation' option is greyed - close image - right click on image icon/file and choose 'properties' allows me to uncheck the 'read-only' and click on 'Apply'. I can then open that image and the eg: 'rotation' option is now available. However, why should anyone need to locate hidden Temp folders just to locate the attachment they want to open. Sounds crazy to me especially when you have not selected to save any file at that point.
see Support Forum:
https://support.mozilla.org/en-US/questions/1376172

For Microsoft Office - Word, Excel etc there is the Trust Center Settings, where you can set up to allow opening of attachment from emails not using the 'Protected view', however this seems to be ineffective and has stopped offering the ''Enable Editing' button.

Why are 'pid-xxxxxx' folders being created?
Why are attachments which use 'Open with' (not save file) being 'saved' as copies in the 'Temp'/'pid-xxxxxx' folder ?
If you use the option  "What should Thunderbird do with this file? Save As ....." instead of  "What should Thunderbird do with this file? Open with ....." then you do not get the pid-xxxx folder.  
But the 'Open With' is in effect saving the files which is not expected nor wanted.

Expect: 
No 'pid-xxxxxx' folder to be created
No auto saving of 'Open With' attachments.
Option to choose to switch to editing mode.

If people are not mentioning this issue, it is possible that users are not aware of the auto saving of opened attachments in newly created pid folders. It is not usual to check the Appdata/Local/Temp file on a regualr basis. You would not expect 'open with' files to be auto saved anywhere without being specifically 'Saved as' in a chosen location.