Setup Email Client
ServerlessInbox is a JMAP mail server. To read and send mail from a desktop or mobile app, you need a client that speaks JMAP and signs in with OAuth.
For users: connecting a compatible client
Section titled “For users: connecting a compatible client”Before you start
Section titled “Before you start”You need:
- Your JMAP hostname — the domain serving your mailbox’s API, referred to below as
<jmap-host>. Your administrator provides this; it is the same host in every URL on this page. - Sign-in credentials — the same ones you use for webmail. You will enter them on the identity provider’s sign-in page, not into the mail client.
Check client compatibility first
Section titled “Check client compatibility first”JMAP client support for OAuth discovery and self-registration is uneven. Some clients work, some partially work, and some have limitations that the server cannot fix.
Three critical questions to ask before setup:
-
Does it discover the OAuth endpoints? A compatible client asks for a JMAP server hostname and finds the rest itself via RFC 8414. A client that asks you to paste an authorization URL, a token URL, or a client ID has not implemented discovery — you will need those values from your administrator.
-
Does it follow the session object? After signing in, a JMAP client must read the
apiUrlfield from the server’s session response and send its API requests there (RFC 8620 §3.1). The session response also includesuploadUrlanddownloadUrlfor blob transfer, both containing URI templates (placeholders like{accountId},{blobId}, etc.) that the client must expand before use. A client that hardcodes API paths or does not expand URL templates will fail. -
Does it expand URI templates? The
uploadUrlanddownloadUrlfields in the session response contain templates with placeholders. The client must substitute the actual values (your account ID, blob ID, etc.) before using those URLs. A client that strips the template syntax and assumes a conventional URL layout will not be able to upload or download attachments.
Outgoing messages and attachments are also subject to an upload size limit — see Upload size limit in the JMAP reference.
Known clients
Section titled “Known clients”| Client | Status | Notes |
|---|---|---|
| Webmail (this server’s browser interface) | Works | No separate installation; access via your server’s web domain. Full JMAP support. |
| Boogie Mail | Works | Desktop JMAP client. Needs a bearer token — it does not perform an OAuth flow. See getting a token below. |
| jmap-cli | Works | Command-line JMAP client. Same bearer token as Boogie Mail. |
Last checked September 2026. Client support changes — if you get another client working, please tell us.
Clients that cannot sign in with OAuth
Section titled “Clients that cannot sign in with OAuth”If your client cannot complete an OAuth sign-in, create a personal access token in the webmail settings and paste it into the client. See Use Access Tokens.
For users: step by step
Section titled “For users: step by step”The exact wording differs between clients, but a compatible client follows this sequence.
-
Add an account and choose JMAP as the account type.
-
Enter your JMAP hostname,
<jmap-host>. Some clients ask for the full discovery URL instead — that ishttps://<jmap-host>/.well-known/jmap. -
Let the client discover the server. It fetches the server’s configuration and, if needed, registers itself to obtain its own credentials. This happens without prompting you and typically takes a moment.
-
Sign in. The client opens a browser window on the identity provider’s sign-in page. Enter your credentials there. This is the expected behaviour — a JMAP client using OAuth should never ask for your password in its own interface.
-
Approve access if you are asked to, and the browser hands control back to the client.
-
Wait for the first sync. The client fetches your mailboxes and recent messages. Initial sync on a large mailbox can take a while.
Your credentials are never given to the mail client. It receives a token from the identity provider, which your administrator can revoke without changing your password.
For operators: creating custom app clients
Section titled “For operators: creating custom app clients”OAuth discovery lists the mail scopes (see Mail scopes for the normative list). A client that registers itself asks for them at sign-in, and the JMAP API refuses a token that carries no mail scopes.
A custom app client is for bearer-token clients such as jmap-cli, and for integration scripts that do not perform an OAuth flow. Create one in your identity provider and configure it with the JMAP scopes.
To enable bearer-token clients (or interactive clients that do require JMAP scopes), create a custom app client with the proper JMAP scopes.
The steps below are for the Cognito IdP addon, which is the identity provider shipped with ServerlessInbox today. If your deployment uses a different provider, create the equivalent client there.
Prerequisites
Section titled “Prerequisites”- AWS Console access to the Cognito user pool created by the deployment
- The mail domain for your server (e.g.,
example.com)
-
Open the Cognito console and navigate to your user pool. The pool name typically matches the pattern
{AccountId}-{StackName}-users. -
Create an app client:
- Go to App integration → App clients and analytics → Create app client
- Client name: Choose a descriptive name (e.g.,
Boogie Mail,jmap-cli, or your custom client name)
-
Configure OAuth flows:
- Authentication flows: Choose one:
- For interactive clients (Boogie Mail, webmail): Enable
ALLOW_CODE_FLOW(or just thecodegrant type) with PKCE - For headless / token-based clients (jmap-cli): Enable
ALLOW_CLIENT_CREDENTIALS_FLOW
- For interactive clients (Boogie Mail, webmail): Enable
- Leave
ALLOW_REFRESH_TOKEN_AUTHenabled
- Authentication flows: Choose one:
-
Set allowed callback URLs (for interactive OAuth flows only):
- For Boogie Mail:
myapp://(or your client’s registered private-use scheme from the application settings) - For browser-based clients: e.g.,
https://yourapp.example.com/callback - Loopback URIs like
http://127.0.0.1:8080/callbackare accepted for desktop apps
- For Boogie Mail:
-
Configure JMAP scopes:
- Under Allowed OAuth Scopes, ensure the following are checked:
- For read-only access:
si/mail.read - For read-write mail:
si/mail.read,si/mail.write - For sending:
si/mail.read,si/mail.write,si/mail.send
- For read-only access:
- Include
openid,email,profilefor standard OIDC (required for OAuth flows; not needed for client credentials)
- Under Allowed OAuth Scopes, ensure the following are checked:
-
Allowed logout URLs (for interactive flows):
- Set to your client’s logout/exit redirect (e.g.,
https://yourapp.example.com/signout)
- Set to your client’s logout/exit redirect (e.g.,
-
Advanced settings (optional):
- Public client:
- Set
Yesif this is a native desktop or mobile app (no client secret) - Set
Noif this is a backend service or web app (generates a client secret)
- Set
- Access token expiration: Default 1 hour is appropriate
- ID token expiration: Default 1 hour is appropriate
- Public client:
-
Create the client and note the Client ID (and Client secret if not public).
Sharing credentials with the client user
Section titled “Sharing credentials with the client user”- Interactive clients (OAuth flow): Give the user the Client ID. The client will use OAuth discovery to find the authorization endpoint automatically.
- Token-based clients (jmap-cli, custom apps): Generate an access token using the client credentials flow (see Machine-to-machine access below) and provide the token to the user.
Machine-to-machine (headless) access
Section titled “Machine-to-machine (headless) access”For applications or CLI tools that need to access the API without a user signing in, use the OAuth 2.0 client_credentials flow.
Provisioning the client (CDK deployments)
Section titled “Provisioning the client (CDK deployments)”If you manage the infrastructure with CDK, call provisionHeadlessClient() on the MailServerUserPool construct to automatically create and configure a client with the required scopes:
const client = userPool.provisionHeadlessClient({ name: 'sync-worker', audiences: ['jmapApi'], // Construct API names, not scope strings: these map to `si/mail.read` and `si/mail.write`. permissions: [Permission.MAIL_READ, Permission.MAIL_WRITE],});
// Store the client secret securely (never in logs or stack outputs)new secretsmanager.Secret(this, 'SyncWorkerClientSecret', { secretName: 'serverlessinbox/headless/sync-worker', secretStringValue: client.clientSecret!,});Using the client (any consumer)
Section titled “Using the client (any consumer)”-
Fetch the client ID and secret securely (from Secrets Manager or your configuration system — never hardcode them).
-
Obtain a token from your identity provider’s token endpoint via HTTP Basic auth. The endpoint is published in the
openid-configurationdiscovery document; with the Cognito addon it takes the form below:
CLIENT_ID="<client-id>"CLIENT_SECRET=$(aws secretsmanager get-secret-value \ --secret-id serverlessinbox/headless/sync-worker \ --query SecretString --output text)
TOKEN=$(curl -s -X POST \ --user "$CLIENT_ID:$CLIENT_SECRET" \ "https://<cognito-domain>/oauth2/token" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" \ -d "scope=si/mail.read si/mail.write si/mail.send" \ | jq -r '.access_token')
unset CLIENT_SECRET # Clear the secret from the environment- Use the token as a Bearer token in JMAP API calls:
curl -s "https://<jmap-host>/.well-known/jmap" \ -H "Authorization: Bearer $TOKEN" | jq .Caution: The access token is short-lived (1 hour by default). Cache it in memory and reuse it until near expiry. Never log, echo, or pass the token via command-line arguments to other processes — use stdin or environment-variable substitution. On multi-user systems, pass the secret via stdin to curl to avoid it being visible in ps.
If setup fails
Section titled “If setup fails”| What you see | What it usually means |
|---|---|
| The client cannot find the server | The hostname is wrong, or <jmap-host> is not reachable from your network. Confirm the hostname with your administrator. |
| A parse or “invalid response” error during setup | Discovery reached something that is not the JMAP server — often a misconfigured proxy or CDN in front of the domain. Report this to your administrator and point them at Configure Authentication. |
| The client asks for a client ID | Either the client does not support self-registration, or registration is disabled on your deployment. Ask your administrator for a client ID (see For operators above). |
| Registration is refused | Your deployment limits how many new client registrations happen per day. Wait and try again, or ask your administrator. |
| Sign-in succeeds, then the client fails | Most often the client is not following the session object — it ignores the apiUrl, uploadUrl, and downloadUrl the server publishes, or it does not expand the URI templates in those URLs. This is a client-side limitation. Try a different client. |
| ”Insufficient scopes” or “403 Forbidden” after sign-in | The client was issued OIDC scopes only (openid, email, profile), not JMAP scopes. This happens when using dynamic registration without a separate setup step. Ask your administrator to create a custom app client with JMAP scopes (see For operators). |
When reporting a problem, include the client name and version, and what the client was doing when it failed (discovering, registering, signing in, or syncing). Those four stages fail for very different reasons.
Related
Section titled “Related”- OAuth Discovery & Dynamic Client Registration — what happens behind the scenes when a client connects
- Configure Authentication — the administrator’s side
- Using the JMAP API — API authentication and session discovery
- Use Webmail — reading mail without a separate client