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 messages list \
--from billing@example.com \
--after 2026-06-01 \
--text invoice --json
What it does

Sync mail locally, query it explicitly

Connect an email account and keep a local copy of messages, threads, labels, folders, and metadata.

💾

Sync mail locally

Keep a normalized copy of inbox data on your machine.

🔍

Query with filters

Filter by sender, recipient, subject, body text, date, state, folder, and labels.

{

Return structured JSON

Use Postmesh from scripts, local tools, and agents without scraping an inbox UI.

Structured Query Interface

Explicit query parameters or MailQuery JSON

Postmesh accepts explicit query parameters from the CLI or a MailQuery JSON object.

postmesh messages list --from notifications@example.com --unread --json
postmesh messages list --query ./mail-query.json --json
mail-query.json
{
  "filter": {
    "from": "billing@example.com",
    "query": "invoice",
    "received_at": {
      "gte": "2026-06-01T00:00:00Z"
    }
  }
}
Built for agents

Agents layer on top of a reliable local mail retrieval API

Postmesh does not try to interpret vague instructions. It gives agents a reliable local mail retrieval layer.

Agent receives task
Agent builds MailQuery
Postmesh returns matching messages
Agent reasons over the results
Install

Then connect an account and run a query.

curl -fsSL https://postmesh.pages.dev/install.sh | sh
$ postmesh connect --provider gmail
$ postmesh sync
$ postmesh messages list --limit 10 --json

Postmesh syncs mail locally and exposes it through structured queries.