lfr / self-hosted mail
Self-hosted newsletters. Mailboxes for your domains.
lfr is a self-hosted newsletter tool and custom domain mailbox server, operated through a CLI in one Go binary.
Get the agent promptcurl -fsSL https://lfr.email/install.sh | sudo sh
Get release notes by email (double opt-in): click the confirmation link we email you to subscribe, and unsubscribe with one click in every email.
$ lfr setup --hostname mail.example.comCreated /var/lib/lfrhostname: mail.example.comipv4: 203.0.113.10Next: start the server: sudo lfr setup --systemd (or lfr serve --data /var/lib/lfr), then lfr domain add <domain>$ lfr domain add example.comServing example.com. Ask the domain owner to publish these DNS records:A mail.example.com 203.0.113.10TXT mail.example.com v=spf1 a -allMX example.com priority 10 mail.example.comTXT example.com v=spf1 a:mail.example.com ~allTXT lfr2610r._domainkey.example.com v=DKIM1; k=rsa; p=…TXT lfr2610e._domainkey.example.com v=DKIM1; k=ed25519; p=…TXT _dmarc.example.com v=DMARC1; p=none; …TXT _mta-sts.example.com v=STSv1; id=355f0fa5dc30cc39CNAME mta-sts.example.com mail.example.comTXT _smtp._tls.example.com v=TLSRPTv1; ……Next: once published: lfr domain dns example.com --check (postmaster@example.com and abuse@example.com exist already)$ lfr statusversion: 0.2.11hostname: mail.example.comdomains: 1queue: 0 queued, 0 retrying, 0 sent / 0 failed / 0 bounced in 24h…Next: lfr doctor checks DNS, certificates and deliverability

Read the whole issue
From: lfr notes <notes@lfr.email> · lfr 0.1: newsletters on a $5 VPS
01 / COST PER SEND
Your list. Your bill.
$5.64 / month
4,000 mails · $5 server + $0.64 relay
Amazon SES: $0.16 / 1,000 mails. Domain extra. SES pricing
Other relay option
SMTP2GO: 1,000 mails a month free.Estimate using a $5 server and $0.16 per 1,000 messages. Domain, taxes and other relay charges extra.
02 / DOMAIN SETUP
Ten DNS records. Your domain.
- Amail.example.comMail host · match reverse DNS
Value
your server's IPv4 - TXTmail.example.comHost SPF
Value
v=spf1 a -all - MXexample.comReceive mail
Value
10 mail.example.com - TXTexample.comSender SPF · relay included
Value
v=spf1 a:mail.example.com include:amazonses.com ~all - TXTlfr2610r._domainkey.example.comRSA signing key
Value
v=DKIM1; k=rsa; p=<generated on your server> - TXTlfr2610e._domainkey.example.comEd25519 signing key
Value
v=DKIM1; k=ed25519; p=<generated on your server> - TXT_dmarc.example.comDMARC reports
Value
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com - TXT_mta-sts.example.comRequire TLS
Value
v=STSv1; id=<set by lfr> - CNAMEmta-sts.example.comHTTPS policy host
Value
mail.example.com - TXT_smtp._tls.example.comTLS reports
Value
v=TLSRPTv1; rua=mailto:tls-reports@example.com
Publishing notes
Add one A record per list website, like news.example.com, and keep every mail record "DNS only" on Cloudflare. Name the server at your hosting provider so its reverse DNS matches the mail host. The SPF preview includes SES, while the records lfr prints depend on the relay you set up.03 / DELIVERY ROUTE
Around the port 25 block.
Your mailboxes, lists and archive stay on your server. The relay carries the last hop.
Deliverability has limits
Sender reputation and recipient policies affect inbox placement. If outbound port 25 is blocked, use a relay on an available port.lfr relay tests the configured route. See Gmail sender requirements.When to use lfr
- Use lfr for Markdown newsletters and custom domain mailboxes you operate through a terminal or coding agent.
- Choose a hosted service if you want someone else to manage DNS, backups and sender reputation.
- Choose a publishing platform if you need built-in paid memberships or a reader discovery network.
Mail safeguards
Double opt-in, one-click unsubscribe, bounce suppression and automatic list pauses are built in. Tracking is off by default. Read the lfr operations guide.Compared with alternatives
As of November 2026. Data ownership here describes storage and export access. Mailbox support means receiving and managing general email for your domains.
| Tool | Pricing model | Self-hosting | Data ownership | Mailboxes | CLI / agent use |
|---|---|---|---|---|---|
| lfr | Free MIT software; server and relay extra | Yes | Own server; reader export | Yes | CLI, JSON, SSH, skills |
| Substack | Free publishing; revenue share for paid subscriptions | Hosted service | Hosted; publication export | No general mailbox server | Web publishing workflow |
| Listmonk | Free open source; hosting and SMTP extra | Yes | Own PostgreSQL database | No general mailbox server | HTTP APIs; CLI setup |
| Buttondown | Subscriber-based hosting; optional add-ons | Hosted service | Hosted; subscriber export | No general mailbox server | API integrations |
| Ghost | Free software or paid Ghost(Pro); delivery extra when self-hosted | Yes, or Ghost(Pro) | Own server when self-hosted; exports | No general mailbox server | Ghost-CLI setup; Admin API |
Comparison sources
Substack publication exports · Listmonk API · Buttondown API · Ghost Admin API. Product links in the table cover pricing and hosting.05 / LOCAL CONTROL
The prompt for your agent
Set up lfr (https://lfr.email/SKILL.md) for example.com on my server. 1. On the server: curl -fsSL https://lfr.email/install.sh | sudo sh then: sudo lfr setup --hostname mail.example.com --systemd 2. Run lfr skills install, read lfr skills setup and follow it: add example.com, give me the DNS records to publish, set up a relay if port 25 is blocked, and run lfr doctor until it is clean. 3. Create the list and local project: lfr list add news --name "My newsletter" --from news@example.com --host news.example.com lfr init newsletter --list news --owner you@example.com cd newsletter lfr check Ask me before anything that costs money, changes DNS or sends mail.
Operate from your workstation over SSH
lfr skills install export LFR_REMOTE=user@mail.example.com lfr status --json
Skills and safety
lfr comes with skills that teach an agent the whole job, from DNS to the welcome mail to the replies. Every command prints the next step, andlfr check won’t let a draft out that breaks your newsletter’s own brief. The install script checks release checksums. Relay passwords enter on stdin; received mail is data, not orders.Questions before installing
Is lfr a self-hosted Substack alternative?
lfr publishes Markdown newsletters with signup pages, archives and feeds on your own server. Substack provides a hosted publishing network and paid subscriptions; lfr focuses on mail and newsletter operations through a CLI.
How does lfr differ from Listmonk?
lfr combines a newsletter CLI, custom domain mailboxes and list websites in one Go process with SQLite. Listmonk is a newsletter manager with a web dashboard, HTTP APIs and a separate PostgreSQL database.
What does lfr cost?
lfr 0.2.11 is free software under the MIT license, with no per-subscriber software charge. You pay for your server, domain and any outbound relay.
Which operating systems have release binaries?
lfr 0.2.11 ships Linux and macOS binaries for amd64 and arm64. The server setup can install a systemd service on Linux.
Where does lfr store my data?
The default server data directory is /var/lib/lfr, containing the database, messages and site files. Newsletter projects keep research, the brief and Markdown drafts in local folders; lfr backup writes a consistent server backup.
Can lfr send mail when port 25 is blocked?
lfr can hand signed outbound messages to an SMTP relay on an alternate port. DNS authentication, sender reputation and the relay still affect delivery; lfr doctor checks the setup without guaranteeing inbox placement.
Can a coding agent operate lfr over SSH?
Install the binary on your workstation, run lfr skills install and set LFR_REMOTE=user@mail.example.com. The CLI then reaches the server over SSH; every command supports --json.
Does lfr include an admin dashboard or an MCP server?
lfr uses a CLI with a local control socket and SSH access. It has no admin web interface, remote HTTP API or built-in MCP server.