#1173·gogcli

Gmail full payload body length differs from raw MIME-decoded body on quoted-printable multipart message

Author: hashtag1974Created Sep 29, 2026Updated Sep 30, 2026
Labelsclawsweeper:no-new-fix-prclawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionP2impact:ux-frictionissue-rating: 🦪 silver shellfish

Summary

GOGCLI v0.42.0, Gmail read-only.

We have one private multipart/alternative message whose text/plain and text/html parts use quoted-printable transfer encoding.

For both parts, gmail get --format full / gmail thread get expose body.data which, after base64url decoding, is 128 bytes larger than both:

  • the part’s declared body.size; and
  • the independently transfer-decoded body from gmail get --format raw.
Part format=full decoded body.data declared body.size raw MIME transfer-decoded
text/plain 2,864 2,736 2,736
text/html 8,757 8,629 8,629

The identical 128-byte discrepancy occurs in both text parts. The raw MIME parser finds exactly one part of each type.

For a successfully decoded MIME text part, callers may reasonably expect decoded body.data to be consistent with body.size, or for any normalization difference to be explicit.

No draft or send was attempted. Our calling workflow fails closed at pre-write quote qualification because it cannot determine which representation should be treated as authoritative or which representation GOGCLI’s native quoted-reply path would use. It does not strip the quote or fall back to manually reconstructed MIME.

Could maintainers clarify:

  1. whether this difference is expected Gmail API normalization of format=full, malformed source MIME, or GOGCLI decoding/normalization behavior;
  2. which representation callers should treat as authoritative;
  3. whether there is a supported native read or quoted-reply verification path that can resolve this before persisting a draft?

We are not asking to relax fail-closed behavior on ambiguous MIME.

The source is private, so no raw message or identifiers are attached. We can provide a synthetic reproduction or sanitized metadata if useful, but not the private message body.

This is distinct from the opt-in missing-CID placeholder behavior in #1113 / PR #1163. That case concerns unresolved inline-image references during quoted draft construction; this case concerns conflicting body representations before draft creation.