Skip to main content
An Outlook mailbox becomes a folder tree, read only: each mail folder a folder of days, each message Microsoft Graph’s own message JSON and its attachments a folder beside it.

Setup

The mount needs a Microsoft Graph access token with Mail.Read. A delegated token reads the signed-in user’s mailbox; an app-only token names the mailbox with user_id.
The fastest way to try it. The token lasts about an hour.
  1. Open Graph Explorer and sign in.
  2. Run GET /me/mailFolders and consent to Mail.Read when asked.
  3. Open the Access token tab and copy the token.
A delegated token from an app registration. The first sign-in is interactive, so this is a development bootstrap, not an unattended credential.
  1. In the Microsoft Entra admin center, go to Entra ID > App registrations > New registration.
  2. Under Authentication, set Allow public client flows to Yes.
  3. Under API permissions > Microsoft Graph > Delegated permissions, add Mail.Read.
  4. Request a device code with the Application (client) ID and the Directory (tenant) ID from the registration’s Overview, open https://microsoft.com/devicelogin and enter the user_code it prints. A registration that accepts accounts in any tenant can use common for the tenant:
  5. After signing in, exchange the device_code for tokens:
Mirage does not refresh Microsoft tokens itself: a long-running program passes a callable as access_token that returns a fresh token.

Connect

workspace.yaml

Layout

  • A mail folder is named by its display name; child folders nest inside it, beside its day folders.
  • A message file is Microsoft Graph’s message JSON, its body as plain text.
  • The part after __ is the message’s immutable Graph id, which stays the same when the message moves folders.

Sample runs

The mount is read-only. Send, reply and forward with the himalaya CLI signed in with a token (see Email setup); the sent copy shows in Sent Items.

SDK guides

Python

Every config field, the layout and the VFS.md.

TypeScript

Every config field, the layout and the VFS.md.