Skip to content

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.


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.

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:

  1. 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.

  2. Does it follow the session object? After signing in, a JMAP client must read the apiUrl field from the server’s session response and send its API requests there (RFC 8620 §3.1). The session response also includes uploadUrl and downloadUrl for 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.

  3. Does it expand URI templates? The uploadUrl and downloadUrl fields 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.


ClientStatusNotes
Webmail (this server’s browser interface)WorksNo separate installation; access via your server’s web domain. Full JMAP support.
Boogie MailWorksDesktop JMAP client. Needs a bearer token — it does not perform an OAuth flow. See getting a token below.
jmap-cliWorksCommand-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.


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.


The exact wording differs between clients, but a compatible client follows this sequence.

  1. Add an account and choose JMAP as the account type.

  2. Enter your JMAP hostname, <jmap-host>. Some clients ask for the full discovery URL instead — that is https://<jmap-host>/.well-known/jmap.

  3. 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.

  4. 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.

  5. Approve access if you are asked to, and the browser hands control back to the client.

  6. 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.

  • AWS Console access to the Cognito user pool created by the deployment
  • The mail domain for your server (e.g., example.com)
  1. Open the Cognito console and navigate to your user pool. The pool name typically matches the pattern {AccountId}-{StackName}-users.

  2. 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)
  3. Configure OAuth flows:

    • Authentication flows: Choose one:
      • For interactive clients (Boogie Mail, webmail): Enable ALLOW_CODE_FLOW (or just the code grant type) with PKCE
      • For headless / token-based clients (jmap-cli): Enable ALLOW_CLIENT_CREDENTIALS_FLOW
    • Leave ALLOW_REFRESH_TOKEN_AUTH enabled
  4. 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/callback are accepted for desktop apps
  5. 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
    • Include openid, email, profile for standard OIDC (required for OAuth flows; not needed for client credentials)
  6. Allowed logout URLs (for interactive flows):

    • Set to your client’s logout/exit redirect (e.g., https://yourapp.example.com/signout)
  7. Advanced settings (optional):

    • Public client:
      • Set Yes if this is a native desktop or mobile app (no client secret)
      • Set No if this is a backend service or web app (generates a client secret)
    • Access token expiration: Default 1 hour is appropriate
    • ID token expiration: Default 1 hour is appropriate
  8. Create the client and note the Client ID (and Client secret if not public).

  • 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.

For applications or CLI tools that need to access the API without a user signing in, use the OAuth 2.0 client_credentials flow.

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!,
});
  1. Fetch the client ID and secret securely (from Secrets Manager or your configuration system — never hardcode them).

  2. Obtain a token from your identity provider’s token endpoint via HTTP Basic auth. The endpoint is published in the openid-configuration discovery document; with the Cognito addon it takes the form below:

Terminal window
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
  1. Use the token as a Bearer token in JMAP API calls:
Terminal window
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.


What you seeWhat it usually means
The client cannot find the serverThe 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 setupDiscovery 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 IDEither 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 refusedYour deployment limits how many new client registrations happen per day. Wait and try again, or ask your administrator.
Sign-in succeeds, then the client failsMost 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-inThe 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.