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

Status Open
Maintainer reply None cached
Activity 6 comments · opened Sep 14, 2026

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 <https://www.example.com/>
``

  1. 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 <a href="https://www.example.com/page/"> also gets its href rewritten; a bare domain inside <code> is wrapped in a redirect <a>.
  • 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^W...), 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

View original on GitHub ↗

3 Comments

tassaramar · 29 days ago

Same here, reproduced today (2026-09-16) from Claude Code CLI with the claude.ai Gmail connector, macOS.

Both send_message and create_draft rewrite every URL in htmlBody (explicit <a href>) and every bare domain in body into https://www.google.com/url?q=<url>&source=gmail&ust=...&sa=E. The rewritten link is what gets stored and sent, so every link in a draft or a delivered mail goes through a Google redirect (and Gmail's UI adds a second hop on click). Plain text without a URL is the only thing left untouched.

This makes drafts prepared for third parties unusable as-is: the recipient sees google.com redirect links instead of the real URL, and the user has to re-paste every link by hand before sending.

Minimal repro: send_message (or create_draft) to self with htmlBody <p><a href="https://app.clickup.com/t/abc">card</a></p>, then get_message / get_draft with FULL_CONTENT: the href is already rewritten in the stored message. When read back, the ust=17... parameter sometimes shows with a raw control character (ust followed by 0x17) instead of ust=17, which suggests an encoding bug in the rewrite step.

nikitabe · 27 days ago

Same here.

thibaultmthh · 26 days ago

Same here, it's super annoying

Showing cached comments. Read the full discussion on GitHub ↗