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 prompt
curl -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.

Star on GitHub
LIVE OUTPUT / lfr 0.2.11
$ 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
Screenshot of lfr’s delivered notes issue rendered at 390 pixel phone width
DELIVERED / lfr notes
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.

1,000 4

$5.64 / month

4,000 mails · $5 server + $0.64 relay

Amazon SES: $0.16 / 1,000 mails. Domain extra. SES pricing

Other relay optionSMTP2GO: 1,000 mails a month free.
MONTHLY / WORKED EXAMPLE
Estimated monthly server and relay costs for the selected send volumeTotal · $5.64Server · $5.00Relay · $0.64

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.

Preview only. lfr generates your keys.

  1. Amail.example.comMail host · match reverse DNS
    Valueyour server's IPv4
  2. TXTmail.example.comHost SPF
    Valuev=spf1 a -all
  3. MXexample.comReceive mail
    Value10 mail.example.com
  4. TXTexample.comSender SPF · relay included
    Valuev=spf1 a:mail.example.com include:amazonses.com ~all
  5. TXTlfr2610r._domainkey.example.comRSA signing key
    Valuev=DKIM1; k=rsa; p=<generated on your server>
  6. TXTlfr2610e._domainkey.example.comEd25519 signing key
    Valuev=DKIM1; k=ed25519; p=<generated on your server>
  7. TXT_dmarc.example.comDMARC reports
    Valuev=DMARC1; p=none; rua=mailto:dmarc-reports@example.com
  8. TXT_mta-sts.example.comRequire TLS
    Valuev=STSv1; id=<set by lfr>
  9. CNAMEmta-sts.example.comHTTPS policy host
    Valuemail.example.com
  10. TXT_smtp._tls.example.comTLS reports
    Valuev=TLSRPTv1; rua=mailto:tls-reports@example.com
Publishing notesAdd 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.

lfr sends through a relay when outbound port 25 is blockedVPS / lfrDKIM signedrelaylast hopreader’s inboxSPF · DKIM · DMARC2465 / 846525port 25 blocked

Your mailboxes, lists and archive stay on your server. The relay carries the last hop.

Deliverability has limitsSender 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

Mail safeguardsDouble 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.

ToolPricing modelSelf-hostingData ownershipMailboxesCLI / agent use
lfrFree MIT software; server and relay extraYesOwn server; reader exportYesCLI, JSON, SSH, skills
SubstackFree publishing; revenue share for paid subscriptionsHosted serviceHosted; publication exportNo general mailbox serverWeb publishing workflow
ListmonkFree open source; hosting and SMTP extraYesOwn PostgreSQL databaseNo general mailbox serverHTTP APIs; CLI setup
ButtondownSubscriber-based hosting; optional add-onsHosted serviceHosted; subscriber exportNo general mailbox serverAPI integrations
GhostFree software or paid Ghost(Pro); delivery extra when self-hostedYes, or Ghost(Pro)Own server when self-hosted; exportsNo general mailbox serverGhost-CLI setup; Admin API
Comparison sourcesSubstack 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 safetylfr 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, and lfr 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.