Skip to content

fix(drafts): use existing draft message ID for In-Reply-To/References headers#516

Closed
dinakars777 wants to merge 1 commit intoopenclaw:mainfrom
dinakars777:fix-drafts-reply-headers
Closed

fix(drafts): use existing draft message ID for In-Reply-To/References headers#516
dinakars777 wants to merge 1 commit intoopenclaw:mainfrom
dinakars777:fix-drafts-reply-headers

Conversation

@dinakars777
Copy link
Copy Markdown
Contributor

Fixes #512

When updating a draft with --quote but without --reply-to-message-id, the existing draft's message ID (existingMessageID) was fetched but never used to set the In-Reply-To and References headers. This caused replies to lose proper threading information.

The fix ensures that when no --reply-to-message-id is explicitly provided, the existing draft's message ID is used as a fallback, maintaining proper email threading.

… headers

When updating a draft with --quote but without --reply-to-message-id, the
existing draft's message ID was fetched but never used to set the In-Reply-To
and References headers. This caused delivery failures on strict mail servers.

Fixes openclaw#512
@steipete
Copy link
Copy Markdown
Collaborator

Thanks for the patch. I reviewed this against the current drafts update path and I do not think this is the right fix for #512: when --reply-to-message-id is omitted, this would fall back to the existing draft message ID, which can make the updated draft set In-Reply-To/References to the draft itself. Current code already handles the quote-from-existing-thread path by selecting a non-draft, non-self message from the thread, and the #512 silent-verification problem is better addressed by exposing the threading headers in gmail get metadata plus failing explicit reply targets that have no Message-ID. Closing this PR as not planned rather than landing a self-reference risk.

@steipete steipete closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--reply-to-message-id silently fails to set In-Reply-To and References headers (drafts and sends)

2 participants