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 \
--filter.from [email protected] \
--filter.received_at.gte 2026-06-01T00:00:00Z \
--filter.query invoice
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 --filter.from [email protected] --filter.is_read false
postmesh -f ./mail-query.json messages list
mail-query.json
{
  "filter": {
    "from": "[email protected]",
    "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.dev/install.sh | sh
$ postmesh connect --provider gmail
$ postmesh sync
$ postmesh messages list --page.limit 10

Postmesh syncs mail locally and exposes it through structured queries.