Protected raw-body path takes a named text/html part with no Content-Disposition as the body #231

Open
opened 2026-11-23 09:02:27 +00:00 by svc-agent-writer · 0 comments

Problem

The raw MIME fallback chooses a body part with EmailMessage.get_body(preferencelist=("plain", "html")) in _message_text (src/mail_mind_mcp/ingest.py). A text/html part that has a name= parameter but no Content-Disposition header is not an attachment to email.message, so it can become the body.

That text goes into protected_body_text. In full mode, assess.message_state puts it into the assessor excerpt, which is one of the fields that leave the host (ADR 0003 §1).

The pinned IMAP body-structure path classifies the same part as an attachment. So the two paths disagree on the same message, and the protected path can send attachment text to the assessor.

Reproduction (generated data only)

A multipart/mixed message whose only part is Content-Type: text/html; charset=utf-8; name=generated-report.html, with no Content-Disposition and the body <p>GeneratedAttachmentOnly</p>:

  • _message_text returns protected = GeneratedAttachmentOnly and no attachments;
  • assess.excerpt(...) returns GeneratedAttachmentOnly.

Observed on main 518bec4f495267839d05f649dc9b00225b973d01 and on PR #230 head e2dd2460228f587de9d453e628a7bbe54c5e495d. This is older than #230, not a regression from it. No live mailbox, deployed mirror or external assessor was used.

Ruling

Operator ruling 2026-11-23: track this separately from #224. #224 goes ahead with its four approved read-side fixes and leaves the protected path as it is. Escalation: #224 comment 47056.

Before implementation

  • Ask mind-spec for a canonical determination on how the protected path classifies a named part with no Content-Disposition.
  • Ratify any ADR amendment that the change needs before merge.

Refs #224, #230

## Problem The raw MIME fallback chooses a body part with `EmailMessage.get_body(preferencelist=("plain", "html"))` in `_message_text` (`src/mail_mind_mcp/ingest.py`). A `text/html` part that has a `name=` parameter but no Content-Disposition header is not an attachment to `email.message`, so it can become the body. That text goes into `protected_body_text`. In full mode, `assess.message_state` puts it into the assessor `excerpt`, which is one of the fields that leave the host (ADR 0003 §1). The pinned IMAP body-structure path classifies the same part as an attachment. So the two paths disagree on the same message, and the protected path can send attachment text to the assessor. ## Reproduction (generated data only) A `multipart/mixed` message whose only part is `Content-Type: text/html; charset=utf-8; name=generated-report.html`, with no Content-Disposition and the body `<p>GeneratedAttachmentOnly</p>`: - `_message_text` returns `protected` = `GeneratedAttachmentOnly` and no attachments; - `assess.excerpt(...)` returns `GeneratedAttachmentOnly`. Observed on main `518bec4f495267839d05f649dc9b00225b973d01` and on PR #230 head `e2dd2460228f587de9d453e628a7bbe54c5e495d`. This is older than #230, not a regression from it. No live mailbox, deployed mirror or external assessor was used. ## Ruling Operator ruling 2026-11-23: track this separately from #224. #224 goes ahead with its four approved read-side fixes and leaves the protected path as it is. Escalation: #224 comment 47056. ## Before implementation - Ask mind-spec for a canonical determination on how the protected path classifies a named part with no Content-Disposition. - Ratify any ADR amendment that the change needs before merge. Refs #224, #230
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#231
No description provided.