ps and shell history would see them. mailkit prompts on stdin with echo off.
Gmail (full access)
You need a Google Desktop OAuth client that you own, with the Gmail API enabled, and the consent screen published to Production (Testing mode expires refresh tokens after 7 days).- In Google Cloud: create (or reuse) a project. Enable Gmail API.
- Consent screen: External is fine. Publish to Production.
- Create an OAuth client of type Desktop app. Download the JSON.
- Store it once:
- Authorize an account (opens a browser):
| Scope | Allows | Does not allow |
|---|---|---|
gmail.modify | Read, labels, archive, trash | Permanent delete |
gmail.compose | Drafts and send | — |
gmail.settings.basic | Filters | Other account settings |
auth add saved a token but could not verify yet, wait 1–2 minutes and run mailkit read.
Fastmail (read-only)
- Fastmail: Settings → Privacy & Security → Manage API tokens → New API token.
- Scope Mail. Mark it read-only.
- Register:
thread are not available on Fastmail. They exit 1 with a clear error.
Proton Mail (read + send, via Bridge)
Proton Mail has no public mail API. mailkit uses Proton Mail Bridge on this Mac. Needs: a paid Proton plan, Bridge installed, signed in, running.- Install Bridge from proton.me/mail/bridge.
- Copy the mailbox password from Bridge. This is not your Proton login.
- Register:
127.0.0.1:1143, SMTP 127.0.0.1:1025. If Bridge is stopped, read and send fail. auth doctor will say Bridge is not reachable.
Check
--force overwrites an address that already has a different provider’s credential. That destroys the old credential. Only use it when you mean to.
Next: Accounts.