Repository navigation
fix(parser): accept documented SES receipt event variants - #5772
Merged
svozza merged 1 commit intoOct 3, 2026
Merged
Conversation
SesSchema required fields that SES only sends conditionally, so common emails were rejected, and it read the Reply-To header under a key SES does not use. - dmarcPolicy is optional, since SES only sends it when the message fails DMARC. - action.invocationType accepts RequestResponse as well as Event, and is optional, since captured events without it exist. - Every commonHeaders field is optional, since each one is present only if the email has the matching header. - The Reply-To header is read from replyTo, the key SES sends, instead of reply-to, which was always stripped. The fixture no longer pairs a DMARC pass with a DMARC policy and now includes a Reply-To header. Closes aws-powertools#5771
svozza
approved these changes
Oct 3, 2026
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.
Summary
SesSchemarequired fields that SES only sends conditionally, so common receipt events failed to parse, and it read the Reply-To header under a key SES does not send. This aligns the schema with the SES receiving notification contents and with a captured receipt event linked in the issue.Changes
receipt.dmarcPolicyoptional. SES sends it only when the message fails DMARC, so every email that passes or gets aGRAYverdict was rejected.receipt.action.invocationTypeto acceptRequestResponseas well asEvent, and made it optional. The docs list both values, and the captured event linked in the issue has noinvocationTypeat all.mail.commonHeadersfield optional. The docs say each one is present only if the incoming email has the matching header, so for example an email sent only to BCC recipients has noto.'reply-to'toreplyTo. The docs' field table and the captured event both usereplyTo, so the header was always stripped. This removes'reply-to'from the inferredSesEventtype, but since SES never sends that key, no parsed event could have had a value there.dmarcPolicyfrom thebase.jsonfixture and the JSDoc example, where it was paired with a DMARC pass, a combination the docs rule out. Added a Reply-To header to the fixture, so the existing round-trip test now coversreplyToand the missingdmarcPolicy.dmarcPolicy, both invocation types, an action without an invocation type, and an email without any common headers. Every new and updated test fails against the schema onmain.Issue number: closes #5771
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.