Skip to content

gh-120946: Add MIME-Version when making EmailMessage multipart - #159852

Open
limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-120946-email-multipart-version
Open

limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-120946-email-multipart-version

Conversation

@limadog9

@limadog9 limadog9 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Multipart messages created with EmailMessage.make_related() or add_related() can omit the required MIME-Version header. Add the header when an EmailMessage is converted to any multipart subtype, preserving an existing header.

Add regressions for all three multipart constructors, the related-image case, existing headers, and the distinction from MIMEPart. Update existing header-count expectations for the added header.

Fixes #120946.

Validation:

  • The new regressions reproduce four failures before the fix.
  • Full email suite on a CPython debug build: 1,825 tests, 2 skipped.
  • Ruff, NEWS lint, and patchcheck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multipart/related mail generated with EmailMessage() class lacks mandatory MIME-Version header

1 participant