anthropics / anthropics/claude-ai-mcp
M365 connector: outlook_send_draft rejects threaded replies whose quoted body contains markup Exchange would sanitize
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 471
- Fork
- 76
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### What happened?
`outlook_create_reply_draft` builds a valid reply draft. `outlook_send_draft` then refuses to send it:
```
VALIDATION_ERROR: Draft body contains content Exchange's SafeHTML filter removes
(scripts, iframes, event handlers, or other active/interactive HTML).
guardrail: body_safehtml_mismatch
```
The offending markup is not mine. It comes from the **quoted body of the message being replied to**, which `outlook_create_reply_draft` appends by design. In my case the original was an ordinary support email containing a hidden tracking `div` (`display:none`, `visibility:hidden`). No attachments and no images were involved.
So an unmodified reply, built entirely by the connector's own tools, cannot be sent by the connector's own send tool.
**Why rejecting is the wrong behavior here.** Exchange's SafeHTML filter already sanitizes the body on send — removing what it does not allow and delivering the rest. The connector instead compares before and after and refuses on any difference. It is stricter than the platform it is protecting against, and it fails on content the user did not write and cannot see.
The same pattern appears in the reply-draft allowlist, where bodies containing `img`, `span`, `font` or `blockquote` are documented as "rejected, not stripped". One disallowed tag anywhere invalidates an otherwise fine message.
Workaround, for anyone else hitting this: `outlook_update_draft` replaces the entire body including the quotation, and the threading headers set at creation survive. Create the reply draft, replace the body with your text alone, then send. The reply still threads correctly; only the quotation is lost.
### What did you expect to happen?
Strip what is not allowed and send the remainder, as Exchange itself does.
If a hard refusal must be kept for some class of content, the error should identify which element triggered it and whether it came from the user's body or from the quoted original. Currently there is no way to tell, so there is no way to fix the body without discarding the quotation entirely.
### Steps to reproduce
1. Receive any email from a marketing or support platform (Intercom, SendGrid, HubSpot — anything that embeds tracking markup). No attachment and no visible image is needed.
2. Call `outlook_create_reply_draft` against that message, with an HTML body that is itself clean against the documented allowlist.
3. Call `outlook_send_draft` on the resulting draft id.
4. It fails with `body_safehtml_mismatch`. The markup that triggers it is in the quoted original, which step 2 appended.
### Area
Tool Discovery / Invocation
### MCP Server (if applicable)
Microsoft 365 (first-party connector in Claude.ai)
### Error messages or logs
```shell
VALIDATION_ERROR: Draft body contains content Exchange's SafeHTML filter removes (scripts, iframes, event handlers, or other active/interactive HTML).
guardrail: body_safehtml_mismatch
```
### Additional context
Related: #867, on a different constraint in the same connector.
The practical effect is that ordinary corporate threads become unsendable through the connector once any participant's message carries tracking markup or an inline signature logo — which is most of them. Drafting works perfectly; only the send step refuses.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.