Skip to content

feat: mailbox parameter on reply_to_email (#89) - #148

Merged
patrickfreyer merged 2 commits into
mainfrom
maint/89-reply-mailbox
Nov 11, 2026
Merged

patrickfreyer merged 2 commits into
mainfrom
maint/89-reply-mailbox

Conversation

@patrickfreyer

Copy link
Copy Markdown
Owner

Posted by Claude (AI maintainer agent) on Patrick's behalf.

Fixes #89.

Problem. reply_to_email only looked for the message in INBOX. A message that a filter delivered to a subfolder, or that had been moved there, couldn't be replied to. The workaround was compose_email with a "Re:" subject, which loses In-Reply-To/References.

Change. A new optional mailbox: str = "INBOX" argument, added at the end of the signature with a default, so it is additive. The lookup now uses the shared build_mailbox_ref helper that search_emails and get_email_thread already use:

  • "INBOX": the same localized-inbox fallback as before (Posteingang, Boîte de réception, …).
  • Nested paths use /, e.g. "ASF/Projects/Magpie/Private".
  • Mailbox names are escaped.
  • If nothing matches, the message names the mailbox that was searched.

Matching is unchanged: same subject-keyword scan, and the first match is the newest message.

This doesn't touch the paste, window, send or verification code. Message-ID targeting (#80, pillar 5) is still a separate piece of work.

Tests. I added 5 tests in ReplyToEmailMailboxTests; 4 of them fail without the change. Full suite: 306 passed on fastmcp 4.1.8 and on the 3.1.0 floor. check_versions.py is OK, and there's a CHANGELOG [Unreleased] entry.


Generated by Claude Code

reply_to_email only looked in INBOX, so a message that a filter delivered
elsewhere, or that was moved into a folder, couldn't be replied to. It now
takes an optional mailbox (default "INBOX", which keeps the localized-inbox
fallback) and resolves it with the shared build_mailbox_ref helper, so
nested paths with / work the same way they do in search_emails. If nothing
matches, the message names the mailbox that was searched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CoqrHbDWCcwDeaFUG7NLZJ
@patrickfreyer
patrickfreyer merged commit fc1af70 into main Nov 11, 2026
5 checks passed

Copy link
Copy Markdown
Owner Author

Posted by Claude (AI maintainer agent) on Patrick's behalf.

Merged.

  • What changed: reply_to_email can now find a message outside INBOX through a new optional mailbox argument (default "INBOX"). It resolves through the same build_mailbox_ref helper that search_emails and get_email_thread already use, so localized inbox names and nested / paths behave the same everywhere.
  • Why it's safe: the change is additive and the default behaviour is equivalent to before. The paste, window, send, read-only and draft-verification code is untouched, and the not-found and error paths still clean up temp files and restore the clipboard.
  • Checks: an independent second reviewer reached MERGE. CI is green on the final head, and the suite passes on fastmcp 4.1.8 and on the 3.1.0 floor. The new tests fail without the change.
  • Not yet done: it hasn't been run against a real Mail.app.

Follow-ups noted, not blocking: a trailing / in mailbox gives Mail's generic error, and an unknown nested path surfaces Mail's raw error instead of "Mailbox not found".


Generated by Claude Code

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_email: add mailbox parameter to find messages outside INBOX

2 participants