feat(inbound): PostmarkInboundParser + InboundEmailController + DI wiring#24
Open
mpge wants to merge 1 commit intofeat/inbound-email-webhookfrom
Open
feat(inbound): PostmarkInboundParser + InboundEmailController + DI wiring#24mpge wants to merge 1 commit intofeat/inbound-email-webhookfrom
mpge wants to merge 1 commit intofeat/inbound-email-webhookfrom
Conversation
…ring
Closes the core inbound webhook for .NET end-to-end:
- PostmarkInboundParser: normalizes Postmark's JSON webhook payload
(FromFull / ToFull / Headers / Attachments fields) into
InboundMessage. Extracts In-Reply-To / References / Message-ID from
the Headers array. Decodes base64 attachment content inline.
- InboundEmailController: POST /support/webhook/email/inbound
- Dispatches to the matching IInboundEmailParser by ?adapter=…
query param or X-Escalated-Adapter header.
- Signature-guarded by X-Escalated-Inbound-Secret (constant-time
compare via CryptographicOperations.FixedTimeEquals). Same
EmailOptions.InboundSecret key that signs Reply-To — symmetric.
- Writes an InboundEmail audit row per request with the resolution
outcome (pending → matched | unmatched | failed).
- Returns 202 Accepted with { inboundId, status, ticketId }.
- AddEscalated() wires InboundEmailRouter + PostmarkInboundParser
into DI. Additional providers (Mailgun, SES) can register by
adding their own IInboundEmailParser implementation.
5 parser tests exercise field extraction, threading header parsing,
base64 attachment decoding, the minimal-payload path, and the
adapter name contract.
Follow-up PRs: Mailgun + SES parsers, attachment persistence, and
reply/ticket-create orchestration based on router outcome.
This was referenced Apr 24, 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
Closes the core inbound-webhook loop for .NET end-to-end, stacked on #23 (router foundation).
PostmarkInboundParser— normalizes Postmark's JSON webhook payload (FromFull/ToFull/Headers/Attachments) intoInboundMessage. ExtractsIn-Reply-To/References/Message-IDfrom theHeadersarray. Decodes base64 attachment content inline.InboundEmailController—POST /support/webhook/email/inboundIInboundEmailParserby?adapter=...query param orX-Escalated-AdapterheaderX-Escalated-Inbound-Secret(constant-time compare viaCryptographicOperations.FixedTimeEquals). Uses the sameEmailOptions.InboundSecretkey that signs Reply-To — symmetricInboundEmailaudit row per request with the resolution outcome (pending→matched|unmatched|failed)202 Acceptedwith{ inboundId, status, ticketId }AddEscalated()wiresInboundEmailRouter+PostmarkInboundParserinto DI. Additional providers (Mailgun, SES) register by adding their ownIInboundEmailParserimplementation.Dependencies
feat/inbound-email-webhook— the router foundation). Will rebase ontomainonce feat(inbound): scaffold InboundMessage + IInboundEmailParser + InboundEmailRouter #23 merges.Test plan