#Emails sent with raw email display name - getting flagged as spam

1 messages · Page 1 of 1 (latest)

native aspen
#

I've set up an agent with its own Gmail address. When the agent sends emails automatically, they show the raw email address as the sender name instead of the display name I set up. When I send manually through Gmail it shows correctly. Because of this the emails keep getting flagged as spam.

Has anyone run into this? Is there a solve?

floral galleonBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

frigid ledgeBOT
#

Yep — seen this a bunch.

What’s usually happening:

  1. Auto send path is using a bare From
  • e.g. From: agent@gmail.com
    instead of
    From: "Agent Name" <agent@gmail.com>
  1. Spam flagging is usually auth/alignment, not just display name:
  • SPF / DKIM / DMARC alignment
  • From vs Sender/Return-Path mismatch
  • New mailbox + repetitive outbound patterns

Quick fix checklist

  • Force explicit sender in the generated MIME:
  • From: "Display Name" <youraddress@gmail.com>
#
  • ideally matching Sender / Reply-To unless intentional
  • If you’re using Gmail API with aliases, make sure the alias is configured/verified in Send mail as.
  • If this is a custom domain, verify SPF + DKIM + DMARC are passing/aligned.
  • Inspect one flagged message in Gmail: Show original and check:
  • From
  • Sender
  • Return-Path
  • Authentication-Results

If you want, paste those four header lines (redact address/domain if needed) and I can tell you exactly which part is tripping spam filters.

Also drop your OpenClaw version (openclaw --version) so we can rule out any known behavior differences.
Docs for baseline debugging: https://docs.openclaw.ai/help/faq and https://docs.openclaw.ai/gateway/troubleshooting

If you also want “has anyone done this exact setup,” ask in #users-helping-users too for real-world sender reputation tips from others.

frigid ledgeBOT
#

Nice, that helps — and yep, v0.12.0 is current.

I checked the gog send flow: it only adds "Display Name <email>" if it can read Gmail SendAs settings.
If that lookup fails (or the display name is empty), it falls back to bare email@....

Try this in order:

gog gmail settings sendas list
  • If this errors with permissions/scope → re-auth with full Gmail scopes:
gog auth add you@gmail.com --services gmail --gmail-scope full --force-consent
  • If it works but display name is blank/wrong → set it explicitly:
#
gog gmail settings sendas update you@gmail.com --display-name "Your Agent Name" --make-default

Then send using explicit from (optional but good sanity check):

gog gmail send --from you@gmail.com --to ... --subject ... --body ...

If you paste the output of gog gmail settings sendas list (redacted), I can tell you exactly which branch you’re hitting.

native aspen
#

its saying the oauth client creds are missing, but it can send emails so not sure how that is possible

frigid ledgeBOT
#

Yep — that’s actually possible, and it usually means you’re hitting two different auth paths.

gog can send mail with:

  • a direct access token (GOG_ACCESS_TOKEN) or service-account path, without local OAuth client JSON

…but gog gmail settings sendas list often goes through the OAuth refresh-token path, which needs local client creds (gog auth credentials ...).

So both can be true at once.

If you want to debug this from your shell, do:

gog auth credentials <oauth-client.json>
gog auth add <agent@gmail.com> --services gmail --gmail-scope full --force-consent
gog gmail settings sendas list
#

Then (if needed):

gog gmail settings sendas update <agent@gmail.com> --display-name "Agent Name" --make-default

If you paste the exact command + exact error, I can tell you which auth path it’s using and the shortest fix.

native aspen
#

zsh: parse error near '/n'

frigid ledgeBOT
#

Ah yep — that’s a shell copy/paste issue.

zsh: parse error near '/n' usually means /n got pasted literally (or line breaks got mangled), and sometimes angle-bracket placeholders (<...>) also break commands.

Run these as separate lines, exactly, with your real values:

gog auth credentials "$HOME/Downloads/client_secret_XXXX.apps.googleusercontent.com.json"
gog auth add "agent@gmail.com" --services gmail --gmail-scope full --force-consent
gog gmail settings sendas list --account "agent@gmail.com"

If needed, then set name:

gog gmail settings sendas update "agent@gmail.com" --display-name "Agent Name" --make-default --account "agent@gmail.com"
#

Key thing: don’t include < >, and don’t paste /n.
If it still errors, paste the exact command you ran and I’ll fix it line by line.

native aspen
#

I ran the first line and it now says dquote>

frigid ledgeBOT
#

Perfect clue — dquote> means zsh is waiting for a closing " (unmatched quote).

Do this:

  1. Press Ctrl+C to exit dquote>.
  2. Run without quotes first (simplest):
gog auth credentials ~/Downloads/client_secret_XXXX.apps.googleusercontent.com.json

If your filename has spaces, use straight quotes and make sure both are present:

gog auth credentials "$HOME/Downloads/client_secret_XXXX.apps.googleusercontent.com.json"
#

Quick sanity check before running:

ls -l ~/Downloads/client_secret*

If you paste the exact command you typed, I can spot the broken character immediately.

native aspen
#

is fg: no current job the response i want

frigid ledgeBOT
#

Nope — fg: no current job is just from typing fg, not from gog. You can ignore it.

Let’s do a clean reset:

  1. Ctrl+C
  2. Find the exact credentials filename:
ls -1 ~/Downloads/client_secret*.json
  1. Copy that exact path into:
gog auth credentials /Users/YOU/Downloads/client_secret_XXXX.json

Expected result: either success/no output, or a clear gog error (not fg/dquote).

If you paste the output of step 2 (ls -1 ...), I’ll give you the exact line to run next.

native aspen
#

it says there is no such user or name

frigid ledgeBOT
#

Got it — that error means a placeholder/path was used literally (like YOU), not your real home path.

Use this exact flow:

echo "$HOME"
ls -1 "$HOME/Downloads" | grep -E '^client_secret.*\.json$'

Then run (replace only FILENAME.json with the real filename from the previous output):

gog auth credentials "$HOME/Downloads/FILENAME.json"

No < >, no YOU, no /Users/... placeholder.

#

If you paste the output of the ls | grep line, I’ll give you the exact command fully filled in.

native aspen
#

after i typed in echo "$HOME"
ls -1 "$HOME/Downloads" | grep -E '^client_secret.*.json$'
Two JSON codes appeared. is that supposed to happen

frigid ledgeBOT
#

Yep — that’s totally normal. It means you have two OAuth client JSON files in Downloads.

Use the newest one:

ls -lt "$HOME/Downloads"/client_secret*.json | head -1

Then run gog auth credentials with that exact filename, e.g.:

gog auth credentials "$HOME/Downloads/client_secret_ABC123.apps.googleusercontent.com.json"

Then continue:

#
gog auth add "agent@gmail.com" --services gmail --gmail-scope full --force-consent
gog gmail settings sendas list --account "agent@gmail.com"

You’re very close now.

native aspen
#

okay

frigid ledgeBOT
#

Nice 👍
Run those next 3 commands, and paste the output of:

gog gmail settings sendas list --account "agent@gmail.com"

Once we see that, we can finish this off quickly.

native aspen
#

done

frigid ledgeBOT
#

Perfect 🙌

Next quick verification:

  1. Send one test email from the agent.
  2. Check recipient inbox + Show original.

You want:

  • From: "Agent Name" <agent@gmail.com>
  • SPF/DKIM/DMARC pass in Authentication-Results.

If the name is still missing, run:

gog gmail settings sendas update "agent@gmail.com" --display-name "Agent Name" --make-default --account "agent@gmail.com"