feat(email): wire MessageIdUtil into EmailService outbound headers#25
Open
mpge wants to merge 1 commit intofeat/email-message-idfrom
Open
feat(email): wire MessageIdUtil into EmailService outbound headers#25mpge wants to merge 1 commit intofeat/email-message-idfrom
mpge wants to merge 1 commit intofeat/email-message-idfrom
Conversation
Uses MessageIdUtil (added in #24) to stamp canonical RFC 5322 Message-ID headers plus signed Reply-To on every outbound ticket email: - Initial ticket notification: <ticket-{id}@{domain}> - Reply notification: <ticket-{id}-reply-{replyId}@{domain}> plus In-Reply-To + References pointing to the ticket-root Message-ID - Reply-To: reply+{id}.{hmac8}@{domain} on all outbound mail so the inbound provider webhook can verify ticket identity independently of the mail client's threading headers. Adds EscalatedProperties.Email config block with: escalated.email.domain (default: localhost) escalated.email.inbound-secret (default: empty — Reply-To skipped) When inbound-secret is blank, Reply-To is omitted but Message-ID + In-Reply-To still land so basic threading works. Removes the previous reliance on ticket.getEmailMessageId() / reply.getEmailMessageId() — these were never populated and yielded null Message-IDs. 5 new unit tests cover the three notification types + the inbound-secret-disabled path, using real MimeMessage + a mocked JavaMailSender so we can assert on actual header values.
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
Wires the
MessageIdUtilhelpers (added in #24) intoEmailServiceso outbound ticket notifications carry canonical RFC 5322 Message-ID headers plus signed Reply-To.Headers set
<ticket-{id}@{domain}>reply+{id}.{hmac8}@{domain}<ticket-{id}-reply-{replyId}@{domain}>The signed Reply-To routes inbound replies back to the right ticket even when the mail client strips our Message-ID / In-Reply-To chain.
Config
New
EscalatedProperties.Email:escalated.email.domain(default:localhost) — right-hand side of Message-IDs + Reply-Toescalated.email.inbound-secret(default: empty — Reply-To is omitted when unset, so basic threading still works without activating the inbound pipeline)Cleanup
Removes the previous reliance on
ticket.getEmailMessageId()/reply.getEmailMessageId()— these fields were never populated and yielded null Message-IDs.Dependencies
feat/email-message-id). Will rebase ontomainonce feat(email): add MessageIdUtil for RFC 5322 threading + signed Reply-To #24 merges.Test plan
MimeMessage+ a mockedJavaMailSenderso assertions are on actual header values.