feat(inbound): PostmarkInboundParser + InboundEmailController#27
Open
mpge wants to merge 1 commit intofeat/inbound-email-routerfrom
Open
feat(inbound): PostmarkInboundParser + InboundEmailController#27mpge wants to merge 1 commit intofeat/inbound-email-routerfrom
mpge wants to merge 1 commit intofeat/inbound-email-routerfrom
Conversation
Closes the core inbound webhook for Spring end-to-end (stacked on #26's router foundation). Mirrors the .NET counterpart (#24). - PostmarkInboundParser (@component): normalizes Postmark's JSON webhook payload (FromFull / ToFull / Headers / Attachments) into InboundMessage. Extracts In-Reply-To / References / Message-ID from the Headers array. Decodes base64 attachment content inline. - InboundEmailController: POST /escalated/webhook/email/inbound - Dispatches to the matching InboundEmailParser by ?adapter=... query param or X-Escalated-Adapter header. - Signature-guarded by X-Escalated-Inbound-Secret (constant-time compare via MessageDigest.isEqual). Same escalated.email.inbound-secret key that signs Reply-To — symmetric. - Returns 202 Accepted with { status, ticketId }, 401 on secret mismatch, 400 on unknown adapter / invalid payload. Additional providers (Mailgun, SES) register by implementing InboundEmailParser as @components — the controller picks them up via DI. 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 for Spring end-to-end (stacked on #26's router foundation). Mirrors the .NET counterpart (escalated-dotnet #24).
PostmarkInboundParser(@Component) — 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 /escalated/webhook/email/inboundInboundEmailParserby?adapter=...query param orX-Escalated-AdapterheaderX-Escalated-Inbound-Secret(constant-time compare viaMessageDigest.isEqual). Uses the sameescalated.email.inbound-secretkey that signs Reply-To — symmetric202 Acceptedwith{ status, ticketId },401on secret mismatch,400on unknown adapter / invalid payloadAdditional providers (Mailgun, SES) register by implementing
InboundEmailParseras@Components — the controller picks them up via DI.Dependencies
feat/inbound-email-router). Merge order: feat(email): add MessageIdUtil for RFC 5322 threading + signed Reply-To #24 → feat(email): wire MessageIdUtil into EmailService outbound headers #25 → feat(inbound): scaffold InboundMessage + InboundEmailParser + InboundEmailRouter #26 → this PR.Test plan