This guide is for setting up a new mail account on a new machine using Ortie (OAuth token flow) and Himalaya (IMAP client).
ortie-config.redacted.toml: Ortie OAuth/account templatehimalaya-config.redacted.toml: Himalaya account templateSETUP_GUIDE.md: this guide
Replace the following placeholders with your real values:
<redacted-email><redacted-name><redacted-login><redacted-app-password><redacted-token-file><redacted-ortie-account>/home/<user>/...
Non-sensitive values are intentionally kept (for example OAuth client-id, auth URLs, token URLs, and scopes).
Install ortie and himalaya so both commands are available in your shell.
Optional (if using brokered access):
uv tool install --upgrade 'clibroker[client] @ git+https://github.com/alanzchen/clibroker'Copy ortie-config.redacted.toml to:
~/.config/ortie/config.toml
Fill all redacted placeholders.
Important requirement:
- Keep
offline_accessin the scopes list.
Without offline_access, you may not get a refresh token, and auth can break after the access token expires.
Copy himalaya-config.redacted.toml to:
~/.config/himalaya/config.toml
Fill all redacted placeholders.
Run your OAuth bootstrap command (example):
~/auth.sh <account_alias>Then complete browser sign-in.
ortie token inspect --account <ortie_account_name>Expected result: refresh token exists (With refresh token: true or equivalent).
himalaya folder list --account <himalaya_account_name> --output jsonIf this fails, fix OAuth/token state first before deeper Himalaya debugging.
If you run Himalaya through clibroker:
clibroker-client execute himalaya -- folder list --account <himalaya_account_name>
clibroker-client execute himalaya -- envelope list --account <himalaya_account_name> --folder INBOX --page 1 --page-size 20Security recommendation:
- Allow read operations only by default (
folder list,envelope list,envelope thread,message read, controlled attachment download). - Deny broad mutation commands unless explicitly required.
If access suddenly breaks:
- Re-run OAuth login.
- Re-check token state:
ortie token inspect --account <ortie_account_name>
- Confirm refresh token is present.
- Re-test Himalaya:
himalaya folder list --account <himalaya_account_name> --output json
- Only after that, troubleshoot broker/container/network layers.
- Do not commit real credentials/tokens/passwords to source control.
- Keep token cache files permission-restricted.
- For password-based providers (for example app passwords), use app-specific credentials and rotate periodically.