Skip to content

Gmail send: display name not included in From header when using service account impersonation #182

@ianpatrickhines

Description

@ianpatrickhines

Bug Description

When sending emails via gog gmail send using service account impersonation (domain-wide delegation), the From header only contains the email address, not the display name configured in the send-as alias. This appears to be a gap in the fix from #93, which works for OAuth-authenticated accounts but not for service account auth.

Steps to Reproduce

  1. Configure a service account with domain-wide delegation:

    gog auth service-account set admin@example.com --key ~/service-account.json
  2. Verify display name is configured for the account:

    gog gmail sendas list --account admin@example.com --json
    # Shows: "displayName": "Company Name", "isPrimary": true
  3. Send an email using service account auth:

    gog gmail send --account admin@example.com --to recipient@example.com --subject "Test" --body "Hello"
  4. Recipient sees From as just the email address:

    From: admin@example.com
    

Expected Behavior

The From header should include the display name from the send-as alias:

From: Company Name <admin@example.com>

This matches the behavior for OAuth-authenticated accounts after #93.

Actual Behavior

Only the email address is included when using service account impersonation. The display name lookup that was added in #93 doesn't appear to run for service account auth paths.

Environment

  • gog version: v0.9.0 (99d9575)
  • OS: macOS (Darwin 25.2.0 arm64)
  • Auth method: Service account with domain-wide delegation

Workaround

Currently none identified. The --from flag requires an exact match on registered send-as alias and doesn't accept display name format.

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions