You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #184 (fixing #182) resolved the display name issue for service-account impersonation, but consumer OAuth accounts are still affected. Issue #243 was closed referencing #184, but that fix doesn't cover the consumer OAuth code path.
Steps to Reproduce
$ gog --version
v0.11.0 (91c4c15 2026-02-15T03:29:18Z)
# People API has the display name
$ gog people me --json | jq '.person.names[0].displayName'"Moeed Ahmed"# But primary SendAs entry has NO displayName field
$ gog gmail sendas get drmoeedahmed@gmail.com --json
{
"sendAs": {
"isDefault": true,
"isPrimary": true,
"sendAsEmail": "drmoeedahmed@gmail.com"
}
}
# Note: no displayName key at all# Send an email
$ gog gmail send --to test@example.com --subject "Test" --body "Test" --force
# Recipient sees From: drmoeedahmed@gmail.com (no name)
Root Cause
For consumer Gmail accounts (@gmail.com), the Gmail API's SendAs.Get and SendAs.List both return no displayName field for the primary address. The fix in #184 falls back from SendAs.Get → SendAs.List, but the list also has no name for the primary entry.
The People API (people/me) does return the correct display name. The fallback chain should be:
Sending via the raw Gmail API with an explicit From: Dr Moeed Ahmed <drmoeedahmed@gmail.com> header in the RFC 2822 message works correctly — Gmail accepts and honours the display name. This confirms the issue is client-side (gog not setting the header), not a Gmail API limitation.
Description
PR #184 (fixing #182) resolved the display name issue for service-account impersonation, but consumer OAuth accounts are still affected. Issue #243 was closed referencing #184, but that fix doesn't cover the consumer OAuth code path.
Steps to Reproduce
Root Cause
For consumer Gmail accounts (
@gmail.com), the Gmail API'sSendAs.GetandSendAs.Listboth return nodisplayNamefield for the primary address. The fix in #184 falls back fromSendAs.Get→SendAs.List, but the list also has no name for the primary entry.The People API (
people/me) does return the correct display name. The fallback chain should be:SendAs.Get→ displayNameSendAs.List→ displayName (current fallback from fix(gmail): fallback to send-as list for display name #184)People.Get('people/me')→ names[0].displayName ← missing stepProof Gmail Accepts Explicit From Headers
Sending via the raw Gmail API with an explicit
From: Dr Moeed Ahmed <drmoeedahmed@gmail.com>header in the RFC 2822 message works correctly — Gmail accepts and honours the display name. This confirms the issue is client-side (gog not setting the header), not a Gmail API limitation.Expected
From: Moeed Ahmed <drmoeedahmed@gmail.com>Actual
From: drmoeedahmed@gmail.comEnvironment
Related
gmail senddoesn't include display name in From header #87 / fix(gmail): include display name in From header for primary account #93 (original display name fix for OAuth — worked for non-primary aliases)