docs(imap): state the permissions a restricted API key needs - #250
Merged
Merged
Conversation
The IMAP/SMTP guide told users to grab an API key and said nothing about permissions, so a restricted key built from a reasonable-looking set (inbox_read, message_read, message_send, drafts) silently fails to sync: LOGIN succeeds, SMTP sends, and the mailbox never updates. That gap produced a real support case — three days of customer-side debugging — and 78 inboxes fleet-wide in the same state. The four `label_*_read` grants are the non-obvious part. All of them are required because the inbox event log IMAP syncs from can carry any restricted label, including `blocked` and `unauthenticated`, which have no IMAP folder of their own and are therefore impossible to guess from the IMAP surface alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Abpr9uYtCN8W4qdG7ub3rH
sidharth0612
approved these changes
Sep 16, 2026
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.
The IMAP/SMTP guide told users to grab an API key and said nothing about permissions. A restricted key built from a reasonable-looking set —
inbox_read,message_read,message_send, drafts — silently fails to sync: LOGIN succeeds, SMTP sends, and the mailbox never updates.That gap produced a real support case (three days of customer-side debugging) and 78 inboxes fleet-wide in the same state.
Adds a callout to Finding Your Credentials with the full required set and the symptom to recognize.
The four
label_*_readgrants are the non-obvious part: all of them are required because the inbox event log IMAP syncs from can carry any restricted label — includingblockedandunauthenticated, which have no IMAP folder of their own and so are impossible to infer from the IMAP surface. An unrestricted key (created without apermissionsobject) is unaffected and works as-is; the callout says so first, so the common case isn't scared off.Pairs with agentmail-to/agentmail-imap#44, which makes the server report this condition as
missing_permissionand relay the remedy to the client in an IMAP[ALERT]instead of mislabeling it as invalid credentials.🤖 Generated with Claude Code
https://claude.ai/code/session_01Abpr9uYtCN8W4qdG7ub3rH