feat(inbound): wire Message_Id_Util parse + verify into InboundEmailService#33
Open
mpge wants to merge 1 commit intofeat/email-service-wireupfrom
Open
feat(inbound): wire Message_Id_Util parse + verify into InboundEmailService#33mpge wants to merge 1 commit intofeat/email-service-wireupfrom
mpge wants to merge 1 commit intofeat/email-service-wireupfrom
Conversation
…ervice Wires Message_Id_Util (#31) + Email_Threading::get_inbound_secret (#32) into InboundEmailService::find_ticket_by_email so inbound mail routes to the correct ticket via canonical Message-ID parsing + signed Reply-To verification. Resolution order (first match wins): 1. In-Reply-To parsed via Message_Id_Util — cold-start path, no DB lookup required. 2. References parsed via Message_Id_Util, each id in order. 3. Signed Reply-To on message['toEmail'] (reply+{id}.{hmac8}@...) verified via Message_Id_Util. Survives clients that strip our threading headers; forged signatures are rejected. 4. Subject line reference tag (legacy). 5. inbound_emails.message_id lookup for any header id (weakest fallback). Extracts the header-id collection into a candidate_header_message_ids() helper so branches 1-2 and 5 share the same In-Reply-To + References parsing logic. 7 new WP integration tests cover every resolution strategy, the forged-signature rejection, the blank-secret skip path, and the no-match fallback.
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
Message_Id_Util(added in #31) +Email_Threading::get_inbound_secret(added in #32) intoInboundEmailService::find_ticket_by_emailso inbound mail routes to the correct ticket via canonical Message-ID parsing + signed Reply-To verification.Resolution order
Message_Id_Util::parse_ticket_id_from_message_id— cold-start path, no DB lookup required.Message_Id_Util, each id in order.message['toEmail'](reply+{id}.{hmac8}@...) verified viaMessage_Id_Util::verify_reply_to. Survives clients that strip our threading headers; forged signatures are rejected.Extracts the header-id collection into a
candidate_header_message_ids()helper so branches 1-2 and 5 share the same In-Reply-To + References parsing logic.Dependencies
feat/email-service-wireup), which is stacked on feat(email): add Message_Id_Util for RFC 5322 threading + signed Reply-To #31 (feat/email-message-id). Merge order: feat(email): add Message_Id_Util for RFC 5322 threading + signed Reply-To #31 → feat(mail): wire Message_Id_Util into Email_Threading + add signed Reply-To #32 → this PR.Test plan