anthropics / anthropics/claude-code

[BUG] Gmail connector rewrites URLs and bare domains in message bodies into google.com/url redirect links

Đang mở
#94,247 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:integrations bug has repro platform:windows
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

## Summary
When creating or updating a draft via the claude.ai Gmail connector (create_draft / update_draft), every URL and bare domain name in the body is saved as a Google redirect link, e.g.

`https://www.example.com/page/` → `https://www.google.com/url?q=https://www.example.com/page/&source=gmail&ust=1789465765136000&sa=E`

The rewritten link is what gets stored and sent, so recipients receive google.com/url links instead of the original URLs.

## Steps to reproduce
1. Call `create_draft` with plain `body`:
```
A1 https://www.example.com/page/
A2 example.com
A3
```
2. Fetch the draft with `get_draft` (messageFormat: RAW) and decode the MIME.

## Actual
- text/plain part: all three lines contain `https://www.google.com/url?q=...&source=gmail&ust=...&sa=E`
- text/html part: same, rendered as plain text
- Passing `htmlBody` with an explicit `` also gets its href rewritten; a bare domain inside `` is wrapped in a redirect ``.
- Email addresses are not affected (they become mailto links).
- `update_draft` on a reply draft also drops the thread association (new threadId) and the quoted original.
- Messages previously sent through the connector (send_message) show the same rewritten URLs in the Sent copy's RAW MIME. In one case the plain-text part contains an unescaped `=17` (`ust...`), i.e. the rewrite is inserted without proper quoted-printable encoding.

## Expected
The body is stored exactly as provided; URLs are not wrapped in google.com/url redirects.

## Impact
Any email containing a link (signature website, product page) is sent with Google redirect URLs. We have had to block the connector's write tools with a PreToolUse hook and compose via the Gmail web UI instead.

## Environment
- Claude Code desktop app (Code tab), Windows 11
- claude.ai Gmail connector (tools: create_draft, update_draft, send_message)
- Observed 2026-09-04 and reproduced 2026-09-14

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

Hướng nghiên cứu

Start by reproducing the behavior through create_draft and update_draft, then fetch the result with get_draft using messageFormat RAW; compare the decoded MIME with the supplied body and htmlBody. Check send_message as well, including reply drafts. Done means URLs remain unchanged, MIME encoding is valid, and update_draft preserves the thread association and quoted original.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.