Repository navigation
Conversation
… primary Gmail returns an empty send-as displayName for a primary address whose name comes from the account. resolve_sender wrote that identity as an explicit bare From, which Gmail delivers verbatim, so recipients saw only the address. Omit the header in that case so Gmail stamps the account's own "Name <address>", as its web client does. Nameless non-primary aliases and explicit --from are unchanged. Fixes googleworkspace#644
🦋 Changeset detectedLatest commit: f329855 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@googleworkspace-bot recheck |
|
This PR has been inactive for 72 hours. Closing to keep the queue clean. |
|
This PR was closed because it has been stalled for 72 hours. Feel free to magically reopen it if you want to continue working on it! |
Description
Fixes #644 for the common case.
Every mail helper (
+send,+reply,+reply-all,+forward, and--draft) resolves its From header inresolve_sender. When no--fromis given, it listssettings.sendAsand uses the default identity. For an ordinary account, Gmail returns that identity as the primary address with an emptydisplayName, because the name comes from the Google account or directory profile.resolve_senderthen wrote an explicit bareFrom: <user@example.com>. Gmail delivers an explicit From exactly as written, so recipients see only the address. The People API fallback only helps when theprofilescope is granted and the People API is enabled in the GCP project, which is why #644 still reproduces with the scope granted (see also #684).With this change, when the default identity is the primary address and has no display name,
resolve_senderreturns no From. Gmail then stamps the account's ownName <address>, as the Gmail web client does. No extra scope or API is needed, and the People API request is no longer made on this path.What stays the same:
From: Name <address>.--fromis unchanged. Bare addresses are still enriched from sendAs.isPrimaryis treated as non-primary, so it keeps the previous behavior.Verified against real Gmail: a message sent through
users.messages.sendwith no From header was delivered asFrom: <Account Name> <address>.Dry Run Output: not applicable (no request-schema change).
Checklist:
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --allto format the code perfectly.cargo clippy -- -D warningsand resolved all warnings.pnpx changeset) to document my changes.