Local email workflows for developers and agents

Postmesh syncs email to local storage, runs configurable pipelines over messages, and stores structured results in queryable collections.

Install Docs
$ postmesh sync --since 30d
$ postmesh messages list --filter.query invoice
$ postmesh workflows apply -f coupons.yaml
$ postmesh records list coupons
What it does

Postmesh is a local email workflow engine

Sync mail locally, run configurable pipelines over messages, and store structured results in queryable collections.

DB

Sync mail locally

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

Y

Run pipelines

Define YAML workflows that select messages with MailQuery, process them with deterministic steps, and write structured output.

{}

Query collections

Store structured records in schema-defined local collections that scripts, tools, and agents can query.

Pipeline example

From messages to structured records

Pipelines select messages, process them, and store results in collections.

$ postmesh workflows apply -f coupons.yaml
$ postmesh pipelines run coupons
$ postmesh records list coupons -o json
coupons.yaml
name: coupons

source:
  type: messages
  query:
    filter:
      query: "coupon OR promo OR discount"
    page:
      limit: 100

process:
  - extract:
      using: regex
      schema: coupons
      fields:
        code:
          input: text
          pattern: "(?:promo code|coupon code|use code|code)[:\\s]+([A-Z0-9-]{4,})"
          group: 1
          normalize: uppercase

store:
  collection: coupons
  mode: upsert
Collections

Collections are local structured datasets

Collections define the schema for records produced from mail. Use them to model things like coupons, bills, receipts, job leads, subscription events, or unsubscribe candidates.

query records
postmesh records list coupons \
  --where.data.merchant Uber \
  --select data.merchant,data.code,data.expires_at,source.message_id
collection.yaml
name: coupons

schema:
  merchant:
    type: string
  code:
    type: string
    required: true
  discount:
    type: string
  expires_at:
    type: date
  source_message_id:
    type: string
    required: true

key:
  fields: [source_message_id, code]
Tools and agents

Built for tools and agents

Postmesh does not need to be the agent. It gives agents and developer tools a local, deterministic interface for retrieving messages and reading structured collection records.

mail sync
→ message query
→ pipeline
→ collection records
→ scripts, tools, agents
Local-first

Local-first by design

Postmesh syncs user-authorized mail to local storage and processes it locally. It uses read-only email access for sync and retrieval, and does not send, delete, archive, label, or modify messages.

Start building local email workflows

Install Postmesh with one command.

curl -fsSL https://postmesh.dev/install.sh | sh
$ postmesh accounts connect gmail
$ postmesh sync --since 30d
$ postmesh messages list --limit 10

Gmail setup note

Postmesh is awaiting Google OAuth verification. During Gmail setup, Google may show an unverified-app notice. Review Google's details before proceeding to Postmesh.

Sync mail locally. Run pipelines. Build collections.