Mail creates duplicate files when re-opening the same attachment

Number:rdar://FB9092463 Date Originated:2021-04-29
Status:Open Resolved:No
Product:Mail Product Version:14.0 (3654.
Classification:Bug Reproducible:Always
- In Finder go to /Users/YOU_USER_NAME/Library/Containers/ Downloads/ so you can watch the attachment files being created. Sort by Date Modified.
- Launch mail
- Select an email with an attachment, e.g. an image, and double click to open it, e.g. it opens in Preview.
- Notice in the Mail Downloads folder a new folder named using a GUID with the file inside.
- Select a different email, then re-select the original email and double click to open the attachment again.
- In the Mail Downloads folder another new folder named using a GUID with a duplicate file inside has been created!

I believe Mail shouldn't create a duplicate files when opening the same mail attachment multiple times. I have many of these duplicates.

I have also tested the Mail preferences "Remove unedited downloads" when mail quits/after mail deleted and these seem to have no effect.

Note: I also noticed that since July 2019 the kMDItemWhereFroms is not filled in for these mail download files, perhaps that is the source of the bug? I'll submit another issue for that bug regardless.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!