A mail client built for hardcore users.

meerail downloads every message you own into PostgreSQL, then puts a familiar email client on top of it. It stays fast on very large mail accounts with hundreds of thousands of messages, years of archive. Real regex search that reads inside your attachments, full keyboard control, and a mailbox any LLM can actually read.

What makes meerail different

Most email clients hide your mail behind a search box someone else designed. meerail hands you the whole archive.

Every message in PostgreSQL

meerail syncs your accounts over IMAP and stores every message, header, recipient and attachment in Postgres — the original .eml bytes included. Nothing is summarised away, and nothing needs the network to read again.

Regex search over everything

Search is a real regular-expression engine over subjects, bodies and extracted attachment text. Match by prefix, alternation or pattern (^Invoice, terminat(e|ion), RN-\d{4}) and scope it by account, folder or a last-N-years window.

Works with Proton Mail Bridge

Proton keeps your mail out of ordinary clients — meerail is built for it. A small agent runs on your machine and talks IMAP and SMTP to Bridge, so your Proton mailbox becomes a searchable archive without your Bridge credentials ever leaving the host. Aliases and additional addresses work too, and because the agent speaks plain IMAP, Gmail and any other provider work the same way.

Feels like the mail app you know

A three-pane Apple-Mail-style layout: mailboxes, conversation list, message. Threading, a unified inbox across accounts, sandboxed HTML with remote images blocked, light and dark. No relearning where anything lives.

Your hands never leave the keyboard

Move, read, flag, archive, reply and search without reaching for the mouse. Single-key shortcuts throughout, so triaging a morning's mail is a few keystrokes rather than a few hundred clicks.

j k / r e

AI ready, by construction

Because the mailbox is a database, an LLM can query it with plain SQL: no scraping, no per-message API calls, no rate limits. Import the skill below and ask questions of ten years of email.

Bring your own model

The skill below points an agent at meerail. This is meerail using a model itself: paste a Claude or OpenAI key — or aim it at an Ollama on your own machine — and a small robot turns up in the four places one is actually worth having.

Nothing is sent anywhere until you press one of them. No background summarising, no indexing through a provider, and no outbound request at all on an install that never set one up. The key is encrypted in your own database and never reaches the browser — every call is made by the server, which is also why it can talk to a model on localhost that your browser cannot see.

Describe the mail; the query lands in the search box, for you to read Ask anything about a whole thread — then put the answer in a reply “Back Thursday — Ada's invoice is due on the 14th” What is this attachment? Documents by their text, screenshots by sight

Self-hosted and open source

One script gets you the server, Postgres and attachment text extraction — even Proton Bridge runs as a container, so the same install works on macOS, Windows and Linux. Your mail stays on your machine, and the whole thing is open source as the meerail project.

Attachments searchable to the last word

Every attachment goes through Apache Tika on the way in, so a search for termination clause finds the PDF that contains it, not just mails that mention it. Photos and scans go through OCR on the same pass — a receipt snapshot becomes text you can regex.

PDF DOCX XLSX PPTX ODF TXT JPEG PNG TIFF

Keep years of mail, not years of attachments

A full mailbox runs to tens of gigabytes, most of it mail nobody will open again. Set agent.content_window_months = 24 and bodies and attachments are kept for recent mail only — older mail still syncs as headers, so it lists, threads and answers a search for its subject or sender. The window slides: stored mail is walked back to headers as it ages out, which makes it a ceiling rather than a one-off tidy-up. Your database is what shrinks, never your mail server.

Last 24 months — body, attachments, full-text search Older — headers only, still listed and searchable

Markdown, plain or rendered

Write **bold** or ## Heading and the composer styles it as you type — without ever hiding the markers, so the field always shows the exact text you are sending. By default that is exactly what goes out: text/plain, no HTML part, nothing for a recipient's client to render differently. Incoming plain-text mail gets the same treatment on the way in.

Press Send as HTML email and the same markdown is rendered instead — headings, lists, quotes, code and links arrive formatted, with the styling written inline so it survives clients that strip stylesheets. It is per message, with the default in Settings, so formatting is a decision you make when it is worth making rather than a mode you live in.

## Release notes
**Ships Friday** — see [the plan](/plan)

Mail that lingers turns red

Inbox rows fade towards red as they age, so a mail you have been avoiding for three weeks looks different from one that arrived this morning. You set the horizon, or 0 to switch it off. Only the inbox is tinted — there, age means unhandled.

today 9 days 18 days 27 days

Turn a mail into a Meerato task

Paste your Meerato private URL into settings and an Add Task button appears on every message. The subject becomes the task title, the body its text, and you tick which attachments ride along. Buckets and statuses are read from your Meerato, so the task lands where it belongs rather than in a default pile. The call is proxied by the server — your token never reaches the browser.

Statistics about how you actually use mail

Because every message is in Postgres, meerail can answer questions a mail client normally cannot: who you really correspond with, how long you take to reply, how much arrives on an average day, and what hours it lands. Pick an account and a window — a week through to everything you have — and it is one query, not an export.

6.02received / day 7h 56mmedian reply 25.9%you reply to

Not today — remind me

One key files a whole conversation away and writes down when to bring it back. It returns unread, to the folder it came out of, so it reads as something that just arrived rather than something buried under a week of mail. The presets are worked out in your own timezone — “next week” means Monday morning where you are — and a sidebar view lists everything waiting. The server watches the clock, so a machine that was off at nine fires its reminders when it comes back: late rather than never.

Later today Tomorrow This weekend Next week Pick a date

Send now, change your mind for a minute

Set a delay and sent mail waits in the Outbox before it goes anywhere — the window in which you can still call it back. It is a real server-side queue, not a countdown in the browser: close the tab, lose the network, restart the machine, and the message still leaves on schedule and can still be stopped until it does. Every queued message carries Send now and Cancel send whatever the delay says, so the setting decides the default and never whether you can intervene. Set it to zero and mail goes at the first opportunity, as it always did.

Re: quarterly figures — leaves in 47sSend Held — you cancelled this oneSend

A list of what just moved your mail

Every action that files mail somewhere else — archive, trash, move, the bulk versions of all three, and parking a conversation on a reminder — lands in a Recent actions panel with an Undo beside it. If the agent has not reached the change yet it is deleted out of the queue and the message goes back verbatim: same folder, same UID, same flags, no trace on either side. If it has already landed, Undo is queued as an ordinary move in the opposite direction. And if it is in flight at that exact moment, meerail says so and asks you to press again rather than guessing — which is how a message ends up in Trash on the server and in Archive on your screen.

Archived 12 messagesUndo Reminded — back MondayUndo Trashed “Newsletter”Undo

Several machines, one set of decisions

Mail syncs itself — a laptop, a desktop and a server on the same accounts already see the same folders and the same read flags. What they cannot see is what meerail decided: a conversation you parked until Monday, an account's footer, the name and colour it wears in your sidebar. IMAP has nowhere to put any of it.

So point every install at one small journal server and they agree. Records are sealed with a passphrase that server never receives — it holds ciphertext and a sequence number, and cannot read a subject, an address, a folder name or a due date. That ordering is also what stops three machines all bringing the same conversation back at nine on Monday: exactly one of them wins the claim. Leave it unconfigured and meerail makes no outbound request at all.

laptop desktop server one sealed journal

You can see your attachments

Attachments show up as thumbnails, not as a row of identical grey paperclips — page one of the PDF, the photo itself. Finding the right invoice is a glance rather than four downloads. The previews are generated once when the mail is synced and stored alongside it, so opening a message with a dozen photos costs a handful of kilobytes instead of pulling every original out of the database.

See it

Real screenshots of a running instance. Click any of them to see it full size.

Unified inbox
Threaded conversations
Regex search
OCR'd scans
Attachment previews
Markdown composer
Age tint
Statistics
Meerato tasks

Drop it into your skills directory and restart your agent:

mkdir -p ~/.claude/skills/meerail
curl -o ~/.claude/skills/meerail/SKILL.md \
  https://raw.githubusercontent.com/ribalba/meerail/main/website/public/downloads/SKILL.md
View SKILL.md on GitHub

The skill connects to your container on localhost. Nothing is sent anywhere you don't send it. Already cloned the repo? It's at website/public/downloads/SKILL.md.

“What did the accountant say about the 2024 filing?” “Every invoice over €500 last year.” “Summarise this thread with the landlord.” “Who emails me most and never gets a reply?”

Get started

One script, three containers, and your mail. You need Docker with the Compose plugin — nothing else, on any operating system.

1. Run the installer

It checks Docker, asks where your mail lives, sizes the stack to the memory your machine actually has, and pulls the published images. No clone, no build, no Python — everything it writes lands in ~/.meerail.

curl -fsSL https://raw.githubusercontent.com/ribalba/meerail/main/meerail.sh -o meerail.sh
bash meerail.sh

2. Proton Mail? Bridge comes with it

Choose Proton and the installer runs Bridge as a container next to the rest of the stack, then walks you through its one-time login. Because the agent reaches it over Docker's own network, this works exactly the same on macOS and Windows as on Linux.

>>> login    # your Proton account
>>> info     # the credentials Bridge made
>>> exit

3. Or any other mailbox

The agent speaks plain IMAP and SMTP, so Gmail, Fastmail, iCloud or your own server work just as well — type your address and the installer fills in that provider's servers. Most of them want an app password rather than your normal one, and it says so.

bash meerail.sh test   # database, Tika,
                       # IMAP and SMTP

4. Open your mail

Accounts show up on their own as the first sync walks your mailbox. bash meerail.sh update takes you to the next release; the app tells you when there is one.

open http://localhost:8000

Prefer to build it yourself?

Clone the repository and the same stack builds from source, with the agent on your own Python if you want it there. That is the path to take if you are going to change meerail rather than just run it — the README has the per-platform detail.

git clone https://github.com/ribalba/meerail.git
cd meerail
cp meerail.example.toml meerail.toml
chmod 600 meerail.toml
docker compose up -d

The full documentation lives on GitHub

These four steps are the short version. Every config option, the agent setup for Proton Bridge and other providers, building the desktop app, the test suite and the architecture notes are all documented in the repository — and the code is right there next to them.