trim_quoted keeps forwarded mail (imap-blade-mcp fix plus pin bump) #113

Closed
opened 2026-11-01 20:54:36 +00:00 by svc-agent-writer · 0 comments

This was generated by AI during triage.

Part of #106 (item 8). Decided at triage 2026-11-02: fix in imap-blade-mcp, then bump the pin here.

Agent Brief

Category: bug
Summary: trim_quoted keeps forwarded mail: do not cut at a header block that follows a forward marker

Current behavior:
mail_read trims quoted replies with trim_quoted from imap-blade-mcp, a pinned git dependency. Its header pattern cuts at any matching From: style line after the first line. A forward that starts Begin forwarded message: followed by a header block keeps only its first line, so the forwarded content is lost.

Desired behavior:
In imap-blade-mcp, trim_quoted recognises a forward marker (Begin forwarded message:, ---------- Forwarded message ---------, -------- Original Message --------, -----Original Message-----, and the same with surrounding whitespace) and does not cut at the header block that follows it. The header block and the forwarded body are kept. Cutting at a reply marker such as On … wrote: or at quote prefixes is unchanged. The omitted-character count stays exact. Then this repo bumps the pinned imap-blade-mcp revision, and a test here reads a forwarded message through mail_read and sees the forwarded body.

Key interfaces:

  • trim_quoted(text) -> (kept, omitted_chars) in imap-blade-mcp: same signature.
  • The imap-blade-mcp pin in this repo's dependency spec and lock.

Acceptance criteria:

  • In imap-blade-mcp: a message Hi\n\nBegin forwarded message:\n\nFrom: a@example.test\nSubject: x\n\nbody keeps every line.
  • In imap-blade-mcp: a reply Thanks\n\nOn Mon, X wrote:\n> quoted still cuts at the On … wrote: line.
  • In imap-blade-mcp: a forward whose forwarded part itself holds a quoted reply cuts at that inner quote, not before the forwarded headers.
  • Here: the pin points at the fixed revision, uv.lock matches, and a mail_read test over a forwarded fixture shows the forwarded body.
  • make check passes in both repos.

Out of scope:

  • A local wrapper or copy of trim_quoted in this repo.
  • Signature trimming rules.

Filed under: operator word "accept" sha256:c125d0397b60

Blocked by

  • dev/imap-blade-mcp#3 — the blade fix. Operator ruling 2026-11-03: only Begin forwarded message: and ---------- Forwarded message --------- are forward markers; Outlook Original Message stays a reply cut. This issue keeps the pin bump to the release that carries #3 and the mail_read forwarded-fixture test.
> *This was generated by AI during triage.* Part of #106 (item 8). Decided at triage 2026-11-02: fix in imap-blade-mcp, then bump the pin here. ## Agent Brief **Category:** bug **Summary:** trim_quoted keeps forwarded mail: do not cut at a header block that follows a forward marker **Current behavior:** mail_read trims quoted replies with `trim_quoted` from imap-blade-mcp, a pinned git dependency. Its header pattern cuts at any matching `From:` style line after the first line. A forward that starts `Begin forwarded message:` followed by a header block keeps only its first line, so the forwarded content is lost. **Desired behavior:** In imap-blade-mcp, `trim_quoted` recognises a forward marker (`Begin forwarded message:`, `---------- Forwarded message ---------`, `-------- Original Message --------`, `-----Original Message-----`, and the same with surrounding whitespace) and does not cut at the header block that follows it. The header block and the forwarded body are kept. Cutting at a reply marker such as `On … wrote:` or at quote prefixes is unchanged. The omitted-character count stays exact. Then this repo bumps the pinned imap-blade-mcp revision, and a test here reads a forwarded message through mail_read and sees the forwarded body. **Key interfaces:** - `trim_quoted(text) -> (kept, omitted_chars)` in imap-blade-mcp: same signature. - The imap-blade-mcp pin in this repo's dependency spec and lock. **Acceptance criteria:** - [ ] In imap-blade-mcp: a message `Hi\n\nBegin forwarded message:\n\nFrom: a@example.test\nSubject: x\n\nbody` keeps every line. - [ ] In imap-blade-mcp: a reply `Thanks\n\nOn Mon, X wrote:\n> quoted` still cuts at the `On … wrote:` line. - [ ] In imap-blade-mcp: a forward whose forwarded part itself holds a quoted reply cuts at that inner quote, not before the forwarded headers. - [ ] Here: the pin points at the fixed revision, `uv.lock` matches, and a mail_read test over a forwarded fixture shows the forwarded body. - [ ] `make check` passes in both repos. **Out of scope:** - A local wrapper or copy of `trim_quoted` in this repo. - Signature trimming rules. Filed under: operator word "accept" sha256:c125d0397b60 ## Blocked by - dev/imap-blade-mcp#3 — the blade fix. Operator ruling 2026-11-03: only `Begin forwarded message:` and `---------- Forwarded message ---------` are forward markers; Outlook `Original Message` stays a reply cut. This issue keeps the pin bump to the release that carries #3 and the `mail_read` forwarded-fixture test.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/mail-mind-mcp#113
No description provided.