Page MenuHomePhabricator

Save mail attachments in Files, not on the actual objects
ClosedPublic

Authored by epriestley on Feb 1 2018, 8:04 PM.
Tags
None
Referenced Files
F18580682: D18986.id45537.diff
Thu, Sep 11, 4:18 AM
F18566538: D18986.id.diff
Tue, Sep 9, 2:42 PM
F18502044: D18986.diff
Thu, Sep 4, 10:09 PM
F18141508: D18986.id45531.diff
Thu, Aug 14, 8:52 AM
F17944714: D18986.id.diff
Jul 31 2025, 10:50 AM
F17937414: D18986.diff
Jul 31 2025, 1:13 AM
F17759216: D18986.diff
Jul 22 2025, 6:12 PM
F17628635: D18986.diff
Jul 10 2025, 7:49 AM
Subscribers
None

Details

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.

Diff Detail

Repository
rP Phabricator
Branch
mail4
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 19321
Build 26116: Run Core Tests
Build 26115: arc lint + arc unit