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.