feat(inbound): SESInboundParser (AWS SES via SNS HTTP subscription)#30
Open
mpge wants to merge 1 commit intofeat/attachment-downloaderfrom
Open
feat(inbound): SESInboundParser (AWS SES via SNS HTTP subscription)#30mpge wants to merge 1 commit intofeat/attachment-downloaderfrom
mpge wants to merge 1 commit intofeat/attachment-downloaderfrom
Conversation
Ports escalated-go#36 to .NET. AWS SES receipt rules publish to
an SNS topic; host apps subscribe via HTTP and SNS POSTs the
envelope to the unified /support/webhook/email/inbound?adapter=ses
webhook.
SESInboundParser handles:
1. Type=SubscriptionConfirmation — throws
SESSubscriptionConfirmationException carrying TopicArn +
SubscribeUrl. Host apps GET the SubscribeUrl out-of-band to
activate the subscription.
2. Type=Notification — parses the JSON-encoded Message field for
mail.commonHeaders (from/to/subject) and the mail.headers
array (Message-ID / In-Reply-To / References threading).
Falls back to mail.headers when commonHeaders doesn't surface
a threading field.
3. Best-effort MIME body extraction from the base64 content
field when SES is configured with action.type=SNS /
encoding=BASE64. Includes an inline MimeMessageParser that
handles single-part text/plain, text/html,
multipart/alternative, and quoted-printable transfer encoding.
No external MIME lib dep.
10 xUnit tests cover: Name check, subscription confirmation path,
full threading metadata extraction, plain body decode, multipart
body decode, missing content → empty body fallback, unknown
envelope type, missing/malformed Message, headers-array
fallback for threading fields.
This was referenced Apr 24, 2026
Open
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
Ports escalated-go#36 to .NET. AWS SES receipt rules publish to an SNS topic; host apps subscribe via HTTP and SNS POSTs the envelope to the unified `/support/webhook/email/inbound?adapter=ses` webhook.
What's handled
`Type=SubscriptionConfirmation` — throws `SESSubscriptionConfirmationException` carrying `TopicArn` + `SubscribeUrl` + `Token`. Host apps GET the `SubscribeUrl` out-of-band to activate the subscription.
`Type=Notification` — parses the JSON-encoded `Message` field for `mail.commonHeaders` (from/to/subject) and the `mail.headers` array (Message-ID / In-Reply-To / References threading). Falls back to `mail.headers` when `commonHeaders` doesn't surface a threading field.
Best-effort MIME body extraction from the base64 `content` field when SES is configured with `action.type=SNS` / `encoding=BASE64`. Includes an inline `MimeMessageParser` that handles single-part `text/plain`, `text/html`, `multipart/alternative`, and `quoted-printable` transfer encoding. No external MIME lib dep — pure stdlib (`System.Net.Mail`, `System.Net.Mime`, `System.Text`).
Tests
10 xUnit cases:
Stacked PR
Based on `feat/attachment-downloader` (#29). Merge order: #23 → #24 → #25 → #26 → #29 → this PR.