Deleting FileDocument does not guarantee that File data is deleted
1
We have a case where an email with an attachment was sent multiple times (thousands of times) and the email Attachment is created in the database as a FileDocument specialization. When deleting the Email and Attachment from the database, it appears like the file data associated with the Attachment/FileDocument is never actually deleted. This causes an undeletable file to remain in storage and causes backups to bloat and take forever. How can I address this and guarantee the file data will be removed when cleaning up the email/attachment/filedocument?