Works with Gmail and Outlook

Query your email from a local database

Postmesh syncs mail to local storage and exposes messages through a structured CLI and JSON interface for scripts, tools, and agents.

Install Docs
$ postmesh -o json messages list \
--filter.from billing@example.com \
--filter.received-at.gte 2026-06-01T00:00:00Z \
--filter.query invoice
What Postmesh Is

A local email sync and query tool

It keeps a local copy of your mail up to date, normalizes message data across providers, and lets other tools query that data through explicit filters.

Connect an account

Authorize a supported email account and keep account sync state locally.

💾

Sync to local storage

Store mail in a local normalized database so queries do not call the provider every time.

{

Expose structured queries

Use explicit filters and JSON output from scripts, tools, and agents.

Not an email client

Postmesh is not a hosted inbox service. It is a local interface for reading email data programmatically.

Not an AI assistant

Agents can build on it, but Postmesh does not need to interpret vague instructions.

🔗

Provider compatibility

Works with Gmail and Outlook while keeping the interface centered on email data.

What Gets Synced

Mail in one normalized local schema

Postmesh syncs provider mail into local storage so queries can run against a stable local data shape.

M

Messages

Subject, body preview, sender, recipients, timestamps

T

Threads

Message relationships grouped by conversation

L

Labels / folders

Provider-specific organization normalized for querying

A

Account data

Connected accounts, read state, provider ids, and sync state

Query Interface

Postmesh queries are explicit

Filter by sender, recipient, subject, body text, date range, read state, folder, labels, and full-text search.

postmesh -o json messages list --filter.from notifications@example.com --filter.is-read false
postmesh -o json messages list --filter.query invoice --page.limit 20
postmesh -o json messages list -f ./mail-query.json
postmesh -o json messages get msg_123
JSON Output

Predictable results for scripts and agents

Results are paginated with cursors so tools can safely walk through larger result sets.

messages list
{
  "messages": [
    {
      "id": "msg_123",
      "subject": "Your June invoice",
      "from_email": "billing@example.com",
      "body_preview": "Your invoice is ready...",
      "received_at": "2026-06-02T14:30:00Z"
    }
  ],
  "next_cursor": "cursor_abc"
}

A local mail retrieval tool

The agent decides what data it needs, builds a structured query, and calls Postmesh. Postmesh returns matching mail as JSON.

  • Agent receives task
  • Agent builds MailQuery
  • Postmesh returns matching messages
  • Agent reasons over the results
agent tool call
const messages = await postmesh.messages.list({
  filter: {
    from: "billing@example.com",
    query: "invoice"
  },
  page: { limit: 20 }
})
Why Local

Mail stays queryable in your environment

Queries run against local storage. Tools do not need to repeatedly call provider APIs, agents do not need to scrape inbox UIs, and data remains available in local developer environments.

Fast local queries

Query local storage instead of waiting on a remote mail API for every lookup.

🔒

No inbox scraping

Give tools and agents a stable interface rather than brittle browser workflows.

🔗

One interface

Different providers can be queried through one normalized local data layer.

Start querying mail locally

Install Postmesh, connect an account, sync mail, and query messages with explicit filters.

curl -fsSL https://postmesh.pages.dev/install.sh | sh
$ postmesh accounts add --provider gmail
$ postmesh accounts sync --email all --full true
$ postmesh -o json messages list --page.limit 10