Repository navigation
Conversation
A Gmail profile signed in with Google now reads users.settings.sendAs.list at each sync and passes every address Gmail accepted (verificationStatus accepted, not the primary) to cli-core as the owner's, beside the configured aliases. The https://mail.google.com/ scope the sign-in already requests allows the call, so no scope is added. gmail.googleapis.com joins the hosts. A failed read (the Gmail API off in the Google project, a network error) keeps the list read last, under the sync-state key mail_send_as, so the owner's alias mail does not turn incoming because Gmail did not answer once. sync reports it as send_as.unread. App-password profiles read no list. Part of cli-core #3321. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sync after a send passes the whole list of the owner's addresses, so it must carry the send-as aliases the last sync read: cli-core treats a given list as complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
cli-core #3321, part a: for a Gmail account, read Gmail's "send as" addresses and count them as the owner's, beside the
aliasesfrom config.Why
mail-cli 0.37.0 (#202) added
aliasesand the Sent folder by role. A Gmail alias that has never sent mail through Gmail still did not belong to the owner unless the owner listed it by hand.What
syncreadsusers.settings.sendAs.list(docs) for a profile signed in with Google (auth: oauth).verificationStatus: accepted.MailAccount.addresses, together withaliases.https://mail.google.com/among the scopes that allow the call, and the sign-in already asks for it.gmail.googleapis.comjoins the allowed hosts (DESKTOP.hosts,contracts/wirecat.json).mail_send_as, so a single failed answer does not turn the owner's alias mail back to incoming.syncreports the cause assend_as.unread, andsend_as.aliasesgives the count.aliasesstays the way to name those addresses.messages sendalso passes the saved send-as list. cli-core #3384 treats a given list as complete, so leaving the list out would drop those aliases.docs/configuration.mdanddocs/oauth-google.md(your own Google app needs the Gmail API turned on).Works on the released cli-core 1.0.0, because these changes only add addresses. Removing an alias (#3321 part b) and the new mail signals are in WireCatLabs/cli-core#3384. mail-cli gets them with the next cli-core release and bump. After that bump, the line in
docs/configuration.mdthat says "config unset aliasesdoes not take it back" must change.Testing
src/oauth.test.ts: a Gmail OAuth sync counts the one accepted alias (not the primary, not the pending one) and sends the token in a header. When Gmail answers 403, the next sync keeps the alias and reportssend_as.unread. No token appears in the output.src/aliases.test.ts: an app-password sync has nosend_as.pnpm typecheck,pnpm lint, the full suite with one worker (31 files, 382 tests),pnpm generate,test:matrix:check,docs:check,standards:check.oauth.test.ts, "keeps every profile's record when sign-ins finish at the same time", failed once under load and passed in three reruns and in the full run. It looks like an existing flake.🤖 Generated with Claude Code