No description
Find a file
2026-07-20 10:42:40 -06:00
.gitignore add yaml config file and cli flags for all settings 2026-07-20 10:42:40 -06:00
config.go add yaml config file and cli flags for all settings 2026-07-20 10:42:40 -06:00
go.mod add yaml config file and cli flags for all settings 2026-07-20 10:42:40 -06:00
go.sum add yaml config file and cli flags for all settings 2026-07-20 10:42:40 -06:00
jmap.go add yaml config file and cli flags for all settings 2026-07-20 10:42:40 -06:00
maildir.go initial commit 2026-07-20 09:04:04 -06:00
main.go add yaml config file and cli flags for all settings 2026-07-20 10:42:40 -06:00
README.md add yaml config file and cli flags for all settings 2026-07-20 10:42:40 -06:00

mbrts

Real-time mail delivery for aerc via Fastmail's JMAP push API.

Connects to Fastmail's JMAP EventSource stream and delivers new messages directly to a local Maildir the moment they arrive — no polling interval.

How it works

  1. Authenticates with the Fastmail JMAP API using a Bearer token
  2. Opens a persistent SSE connection to receive StateChange events
  3. On each email state change, calls Email/changes + Email/get + Mailbox/get to fetch new messages and their destination folders
  4. Downloads each message as RFC 2822 and delivers it to the correct Maildir folder
  5. Runs notmuch new to index the delivery

Setup

Create a Fastmail API token at Settings → Security → API Tokens.

Configure each account in main.go with a passwordCommand — any shell command that writes the token to stdout. Build and run:

CGO_ENABLED=0 go build -o mbrts . && ./mbrts

aerc should be configured with a maildir:// source so it picks up delivered messages immediately via inotify.