feat: reply to the Reply-To address when the sender set one#79
Conversation
Replies always targeted the From: address, so a reply to a mailing-list digest or a no-reply@ sender went to the wrong place — exactly the addresses that set Reply-To to redirect responses. Capture the Reply-To header into the message body metadata at parse time (mail-parse already has the parsed message, so every provider benefits), and have the reply builder prefer those addresses over From:, falling back to From: when absent. The metadata is a JSON blob with a serde-default field, so no migration or envelope-schema change is needed. Gmail thread-id propagation — the other half of this backlog item — is already in place: the Gmail parser uses the API's threadId directly as the envelope thread id.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 34 minutes and 47 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Replies now target the original message's
Reply-To:header when the sender set one, instead of always usingFrom:. Final audit backlog item P1 #16. Offmain; no migration.Why
A reply to a mailing-list digest or a
no-reply@sender went to the wrong place — those are exactly the senders that setReply-Toto redirect responses. The reply builder even carried a comment: "Envelope does not yet capture the Reply-To: header — using From: as the reply target."How
mail-parsealready has the fully parsed message, soextract_metadatanow pullsReply-Toaddresses intoMessageMetadata.reply_to. Every provider (Gmail/IMAP/fake) routes through this, so all benefit.MessageMetadatais stored as a JSON blob in the body row and derivesDefault; the new field is#[serde(default)], so old rows deserialize fine and every existing..Default::default()literal keeps compiling (verified: the whole workspace test suite compiles unchanged).body.metadata.reply_to.first()and uses it as the target, falling back toFrom:when absent.reply-alladds the other original recipients as Cc on top.Gmail thread-id (the other half of this item) — already done
Verified the Gmail parser already uses the API's
threadIddirectly as the envelope thread id (provider-gmail/src/parse.rs), so Gmail replies already rethread correctly. No change needed.Verification
mail-parse: new tests — Reply-To captured into metadata (name + email), and absent Reply-To leaves it empty. 15 pass.mxrdaemon: newdispatch_prepare_reply_prefers_reply_to_header— a message whose Reply-To differs from From produces a reply targeting Reply-To. 476 pass (the lone failure is the pre-existingdispatch_sync_now_acknowledgesflake that fix: detach sync on timeout instead of cancelling mid-flight #62 fixes).mxr-core42 pass; clippy + fmt clean across all three crates.guides/compose.mddocuments the reply-recipient rule.Generated with Claude Code
Summary by cubic
Replies now use the original message’s Reply-To when present, fixing replies to mailing lists and no-reply senders. Changes are backward compatible and complete Linear P1 #16.
mail-parse: capture and storeReply-ToasMessageMetadata.reply_to(serde default; no migration).Reply-To(first address) and falls back toFrom;reply-allkeeps other original recipients as Cc.mail-parseand daemon; updated the compose guide.Written for commit af02b7c. Summary will update on new commits.