Repository navigation
Keep the sender's display name with the SES transport - #791
Merged
taylorotwell merged 2 commits intoDec 3, 2026
Merged
Conversation
chrisreedio
force-pushed
the
fix/ses-sender-display-name
branch
2 times, most recently
from
December 3, 2026 21:04
96ced93 to
f2ef447
Compare
SES v2 SendEmail lets FromEmailAddress replace a raw message's From header, so passing the bare address dropped the sender's display name. SES reads the sender from the header, which the message always carries. Co-authored-by: Chris Reed <[email protected]>
chrisreedio
force-pushed
the
fix/ses-sender-display-name
branch
from
December 3, 2026 21:05
f2ef447 to
73e07de
Compare
Member
|
This is an automated, agent-powered review. Confirmed. The
Thanks for your contribution, a human review will follow shortly. |
chrisreedio
marked this pull request as ready for review
December 3, 2026 22:35
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.
Emails sent with the
sestransport lose the sender's display name. With[email protected]andMAIL_FROM_NAME=Example, recipients see[email protected]rather thanExample <[email protected]>. A per-messageMessage::from((address, name))loses its name the same way. Theresendtransport keeps it.Why
SesTransportsends raw MIME, andEmail::to_mimewrites the correct header:From: "Example" <[email protected]>. The transport also sets SES v2SendEmail'sFromEmailAddressto the bare address, and for raw content SES v2 letsFromEmailAddressreplace the message'sFromheader. (SES v1'sSendRawEmailpreferred the header overSource; nodemailer#1430 ran into the same difference.)FromEmailAddressis optional for raw content. Without it, SES takes the sender from theFromheader. The transport doesn't use sending authorization, the one case where it's needed.How we verified it
We sent one raw message, whose header was
From: "Example" <[email protected]>, through SES v2 twice from a verified domain to an inbox we could read. The only difference between the two sends wasFromEmailAddress:SendEmailcallFromheader received[email protected](the transport today)From: [email protected]FromEmailAddress(this PR)From: Example <[email protected]>A production email sent by the transport showed the same bare
From, with DKIM passing over it, so the name was gone before it left SES. We now run this change through[patch.crates-io].Changes
crates/notifications/src/mail/ses.rs: stop settingfrom_email_address.tests/mail.rs:ses_sends_raw_mime_with_every_recipient_in_the_envelopeasserted thatFromEmailAddresswas sent. It now asserts that it isn't, and that the rawFromheader carries the encoded name (Café Zoë) with the address.Checks run
cargo fmt --all -- --checkcargo clippy -p laravel-rust-notifications --all-targets --all-features -- -D warningscargo test --all-features --test queue ses_: 19 passed. With theses.rschange reverted, the updated test fails on theFromEmailAddressassertion.