Repository navigation
Read messages that Mail stores only as partial files - #7
Merged
Merged
Conversation
Mail writes <rowid>.partial.emlx when it stores some parts of a message, such as attachments and inline images, in separate files. The partial file keeps the headers and the text parts, and leaves the body of each separate part empty, with an X-Apple-Content-Length field. Envelope threw MailError.partialMessage for these messages. The reader now reads the partial file when no complete .emlx file exists, with the same containment and size checks. Content.attachments lists the parts that have a filename or that Mail stores separately, and isStoredSeparately marks the parts whose content the file leaves out. A part that Mail stores separately cannot supply the body; when no other part can, Content throws EmlxError.partialMessage. MailError.partialMessage is deprecated, and its text no longer says that opening the message in Mail downloads it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In mattt/iMCP,
mail_messages_readfailed for 6 of the 15 newest messages in a real V10 store, with "Mail has downloaded only part of the message. Open the message in Mail to download it." In an earlier case, opening such a message in Mail did not make it readable. Each of these messages exists only as<rowid>.partial.emlx, and each of those files keeps the headers and the text parts. In 4 of the 6, some parts, such as attachments and inline images, have an empty body and anX-Apple-Content-Lengthheader, and their content is inAttachments/<rowid>/<part>/. The other 2 have no such parts.This PR makes the store read a message's
.partial.emlxfile when its mailbox has no complete.emlxfile, with the same containment, size, and duplicate checks. A complete file still takes precedence, including over a cached partial location.Content.attachmentslists the parts that have a filename or that Mail stores separately, with their media type andisStoredSeparately.attachmentFilenamesnow comes from this list.A part that Mail stores separately cannot supply the body. When no other part can,
ContentthrowsEmlxError.partialMessage. Envelope no longer throwsMailError.partialMessage, so this PR deprecates it, and its text no longer says that opening the message in Mail downloads it. The README and the MIME behavior specification describe partial files.