HomePhabricator

Save mail attachments in Files, not on the actual objects

Description

Save mail attachments in Files, not on the actual objects

Summary:
Depends on D18985. Ref T13053. See PHI125. Currently, mail attachments are just encoded onto the actual objects in the MetaMTAMail table.

This fails if attachments can't be encoded in JSON -- e.g., they aren't UTF8. This happens most often when revisions or commits attach patches to mail and those patches contain source code changes for files that are not encoded in UTF8.

Instead, save attachments in (and load attachments from) Files.

Test Plan: Enabled patches for mail, created a revision, saw it attach a patch. Viewed mail in web UI, saw link to download patch. Followed link, saw sensible file. Checked database, saw a filePHID. Destroyed mail with bin/remove destroy, saw attached files also destroyed.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13053

Differential Revision: https://secure.phabricator.com/D18986

Details

Provenance
epriestleyAuthored on Feb 1 2018, 7:17 PM
epriestleyPushed on Feb 2 2018, 10:38 PM
Reviewer
amckinley
Differential Revision
D18986: Save mail attachments in Files, not on the actual objects
Parents
rPeb06aca951ce: Support DestructionEngine in MetaMTAMail
Branches
Unknown
Tags
Unknown
Tasks
T13053: Plans: Mail Tags and Failover
Build Status
Buildable 19331
Build 26127: Run Core Tests