A reply to a self-addressed message follows its Reply-To #416

Closed
opened 2026-09-20 21:25:37 +00:00 by jcoffey-dev · 0 comments
Owner

Fixes #415.

A website contact form mails the site's own address: From and To are both info@thesite, and the person who filled the form in is in Reply-To. Replying addressed the draft to info@thesite — the site's own desk — instead of to them.

The reply already knows two shapes. A message somebody sent me is answered to its Reply-To, which is what that header is for. A message I sent is answered to the people I wrote to, and deliberately not to my own Reply-To, which is where answers to me belong and would send my reply to myself. A contact form passes the test for the second: every address in From is mine.

So it fell down the chain the second shape keeps for a message with nobody obvious to answer — To without me, then Cc, then, having run out, every address on the message, which here was mine alone.

The Reply-To now goes in that chain, one step before the last: when no recipient but me is left and the message names a Reply-To that is not mine either, that address is who it is really from. Keeping it after the Cc is what leaves a message I did send alone — somebody I actually wrote to still beats my own Reply-To, which is the case the existing guard was built for and its test still holds.

Three tests: the contact form on reply and on reply all, and the message of mine that the Cc still wins. The first two fail without the change.

No new strings.

🤖 Generated with Claude Code

Merged 2026-09-20 as coffey-labs/ihasmail@01dc322aeb

Rebuilt from: git history, session transcript.

Fixes #415. A website contact form mails the site's own address: From and To are both `info@thesite`, and the person who filled the form in is in `Reply-To`. Replying addressed the draft to `info@thesite` — the site's own desk — instead of to them. The reply already knows two shapes. A message somebody sent me is answered to its `Reply-To`, which is what that header is for. A message *I* sent is answered to the people I wrote to, and deliberately not to my own `Reply-To`, which is where answers to me belong and would send my reply to myself. A contact form passes the test for the second: every address in From is mine. So it fell down the chain the second shape keeps for a message with nobody obvious to answer — To without me, then Cc, then, having run out, every address on the message, which here was mine alone. The `Reply-To` now goes in that chain, one step before the last: when no recipient but me is left and the message names a `Reply-To` that is not mine either, that address is who it is really from. Keeping it after the Cc is what leaves a message I did send alone — somebody I actually wrote to still beats my own `Reply-To`, which is the case the existing guard was built for and its test still holds. Three tests: the contact form on reply and on reply all, and the message of mine that the Cc still wins. The first two fail without the change. No new strings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) **Merged** 2026-09-20 as coffey-labs/ihasmail@01dc322aebcf <sub>Rebuilt from: git history, session transcript.</sub>
This repo is archived. You cannot comment on issues.