Backend/emails: Support custom SMTP headers for attachments#8665
Merged
tristanlabelle merged 7 commits intoMay 26, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tristanlabelle
commented
May 17, 2026
tristanlabelle
marked this pull request as ready for review
May 18, 2026 06:33
aapeliv
previously approved these changes
May 25, 2026
tristanlabelle
force-pushed
the
backend/bugfix/email-attachments-headers
branch
from
May 26, 2026 20:28
55102de to
6b483ad
Compare
Contributor
Author
|
Rebased to resolve conflicts (adjacent import lines had changed in |
Contributor
📝 Release NotesThis PR should be included in the release notes. Suggested release note: 🤖 Bot Debug InformationModel: |
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.
ics attachments are trickier than I thought, one of the ics field (
method) also needs to be replicated as an SMTP header on the attachment for correct support by email clients.EmailAttachmentwasn't flexible enough to represent this, so I switched it over to specifying theContent-TypeandContent-Dispositionheaders directly, which is as generic as it gets. This should improve calendar event compatibility and behavior in email clients.There's some extra dance to support unquoted
method=XXXin the SMTP header (not the default Python behavior) since Gemini said that was preferred for backcompat with old email clients.Testing
Ran locally, accepted host requests and downloaded emails from MailDev while iterating until I got this desired form for the attachment:
Backend checklist
developif necessary for linear migration historyFor maintainers