Skip to main content
OutlookVFS mounts an Outlook mailbox read only through Microsoft Graph: each mail folder becomes a folder of days, each message Graph’s own message JSON and its attachments a folder beside it. Set up a token as in Outlook setup.

Install

Configure

With no userId, the mount is the signed-in user’s mailbox (/me).

Fields

string | function
required
secret
Microsoft Graph bearer token, or a function (sync or async) that returns one; it is called for each request and again after a 401.
string
Full Graph service root, version segment included, for any deployment but the worldwide one: a sovereign cloud, a private endpoint or a test server. Unset uses https://graph.microsoft.com/v1.0.
number
default:"DEFAULT_TIMEOUT"
Seconds a Graph request may wait to connect, or between two reads of its answer, before it fails; also how long a server-side copy is polled before it fails as unconfirmed.
number
default:"5"
Times a request is retried after a 429, 503 or 504 response. Each retry waits what Retry-After asks or an exponential backoff, at most 30 seconds.
string
User ID or UPN whose mailbox the mount reads, under app-only auth; unset reads the signed-in user’s.
number
default:"1000"
How many of a folder’s newest messages the mount lists and grep searches; a day directory or a glob over days lists at most this many of its own.
Fields marked secret are redacted in snapshots.

Authentication

accessToken is a Microsoft Graph bearer token, or a function that returns one. A function is called for each request and again after a 401, so a long-running mount outlives one token; a plain string lasts about an hour. A delegated token reads the signed-in user’s mailbox. An app-only token cannot use /me, so it sets userId to the user’s id or UPN. Either needs Mail.Read, or Mail.Read.Shared for another user’s mailbox under a delegated token.

Layout

  • A mail folder is named by its display name, with / shown as ∕. Child folders nest inside their parent, beside its day folders, to any depth; a child folder whose name reads as a date carries __<folder-id>, so a date always names a day.
  • Inside a folder, one folder per day: the UTC date each message was received.
  • A message file is named <subject>__<message-id>.outlook.json, the subject sanitized and cut short when needed. ls the day rather than build the name. The id is the message’s immutable Graph id, which stays the same when the message moves folders.
  • A message with file attachments has a folder of the same name without .outlook.json, holding them by their Outlook names. A name two attachments share takes the later one’s position, as scan__2.txt.

Behavior

  • Read only: no command changes the mailbox.
  • Graph’s JSON: a .outlook.json is the message as Microsoft Graph answers it, cut to the fields a message keeps once delivered: id, subject, from, toRecipients, ccRecipients, bccRecipients, replyTo, receivedDateTime, sentDateTime, importance, isDraft, hasAttachments, conversationId, internetMessageId, bodyPreview and body. The body is plain text. Read state, flags and categories change after delivery and are left out.
  • Recent window: ls of a folder lists its child folders and the days of its maxMessages most recent messages, 1000 unless set. A glob over the day names (ls /outlook/Inbox/2026-03-*) or a day folder named directly reaches older days, each listing at most maxMessages of its own.
  • Stable names: the id in a name is Graph’s immutable id, so a message keeps its name when it moves to another folder.
  • Dates: a message, its attachment folder and its attachments are dated when the message was received (receivedDateTime).
  • Attachments: a message’s file attachments are listed with no size, since Graph’s attachment size counts more than the content; cat reads the bytes. Attached Outlook items and links are not listed.
  • Service root: mounts address https://graph.microsoft.com/v1.0 unless graphBaseUrl names another root, given in full with its version segment.

Integration

Outlook answers these commands from what its listing already fetched, so fewer messages are read. See Integration.
  • grep -r and rg: listing a folder fetches its messages in full, and the listing keeps each message’s text. Only the messages whose text holds the pattern’s text, in any case, are read, and the output is what reading every message prints. Outlook’s own search is not used, since it matches whole words and stops at 1,000 messages. Attachments are always read, and so is every message for a text that is not ASCII. With walk_limit: -1 in the mount’s "@all" command limit, the listing keeps no text and every message is read.

VFS.md

The VFS.md an agent reads with Outlook mounted at /<path>.
Virtual FilesystemVFS Layout/<path>
  • <folder> is an Outlook mail folder by its display name; a child folder sits inside its parent beside the day directories, and one named like a date carries __<folder-id>.
  • <yyyy-mm-dd> is the UTC day the message was received. A folder lists its most recent messages; listing a day, or globbing one such as 2026-03-*, queries only those days.
  • ls a day directory for the names rather than building <subject>.
  • A .outlook.json is Microsoft Graph’s own message JSON: .subject, .from.emailAddress, .toRecipients[], .ccRecipients[], .receivedDateTime, .body.content (plain text), .hasAttachments, .conversationId. Read state, flags and categories are not in it.
  • The sibling directory holds attachments only (cat one for its bytes) and is absent when there are none.
  • The mount is read-only.
Supported Unix Commands for VFSUnix commands work on each path as on a local filesystem, as far as the path supports them:Limitations of Unix Commands for VFSWhere a path differs from a local filesystem:Run man <cmd> or <cmd> --help for one command’s usage.