Repository navigation
Fix text attachment MIME grouping - #232
Open
dajiaohuang wants to merge 2 commits into
Open
dajiaohuang wants to merge 2 commits into
dajiaohuang wants to merge 2 commits into
Conversation
Member
|
@andrewtimberlake thoughts? |
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.
Changes proposed in this pull request
Text attachments currently enter the body-alternative group solely because their MIME type is
text/plainortext/html. For a message with plain and HTML bodies plusnotes.txt, the rendered root becomesmultipart/alternative, and Python's standard email consumer exposes no attachment throughiter_attachments().Exclude parts with attachment or inline disposition from the body group using the existing
Mail.Message.is_attachment?/2predicate. This preserves the renderer's existing mixed/related/alternative layout: regular text attachments sit outside body alternatives, and inline text parts remain related to them. This follows the distinction between alternative representations and independent parts in RFC 2046 §5.1.4.Add three render/parse regressions covering
.txt,.html, and inline text attachments, including MIME structure and recovered attachment payloads.Validation on Elixir 1.14.0 / Erlang OTP 25:
mix test: 39 doctests and 266 tests pass.mix format --check-formatted lib/mail/renderers/rfc_2822.ex test/mail/renderers/text_attachment_test.exspasses.No SMTP delivery or real mail-client acceptance was performed; other runtime versions and hosted CI were not run locally.