Karta (KAR-tah, Papiamentu for letter): a mail platform in Elixir. Upstream.
  • Elixir 98.9%
  • Ruby 0.3%
  • Shell 0.3%
  • Python 0.2%
  • CSS 0.1%
Find a file
calvin de83ca26d8
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Merge pull request 'Use the canonical Karta small icon' (#105) from cx22/karta-small-icon into master
2026-11-19 12:20:46 +00:00
assets Delay the reconnecting notices by three seconds 2026-11-13 10:37:23 -04:00
config Per-replica EHLO name: KARTA_OUTBOUND_HOSTNAME=auto 2026-11-15 23:47:04 -04:00
deploy/examples Per-replica EHLO name: KARTA_OUTBOUND_HOSTNAME=auto 2026-11-15 23:47:04 -04:00
dev Run the replicas harness in Docker with one command 2026-11-11 22:33:30 -04:00
guides Use the canonical Karta small icon and clear the dependency audit 2026-11-19 08:11:57 -04:00
lib Per-replica EHLO name: KARTA_OUTBOUND_HOSTNAME=auto 2026-11-15 23:47:04 -04:00
priv Use the canonical Karta small icon and clear the dependency audit 2026-11-19 08:11:57 -04:00
protocol Copy the whole protocol document, with the answer to change 2 2026-11-13 02:04:27 -04:00
rel/overlays/bin Find the replicas through the database with the libcluster_postgres fork, and a three-replica harness 2026-11-11 22:24:16 -04:00
test Domain page test: the ownership grace is relative to now 2026-11-18 01:51:56 -04:00
.credo.exs Karta: initial import 2026-11-07 01:56:31 -04:00
.dockerignore Karta: initial import 2026-11-07 01:56:31 -04:00
.formatter.exs feat(api): /api/v2 with an OpenAPI 3.1 document: sending and message status 2026-11-07 10:49:19 -04:00
.gitattributes test(mail): synthetic MIME corpus with byte-exact and rebuild round trips 2026-11-07 05:06:23 -04:00
.gitignore Do not commit Python caches 2026-11-11 22:24:55 -04:00
.sobelow-conf feat(smtp): development CA and certificate generator task 2026-11-07 03:53:58 -04:00
.tool-versions Karta: initial import 2026-11-07 01:56:31 -04:00
.woodpecker.yml build: cmake in CI and the image builder, so lazy_html can build from source 2026-11-09 02:03:16 -04:00
AGENTS.md Karta: initial import 2026-11-07 01:56:31 -04:00
CHANGELOG.md Per-replica EHLO name: KARTA_OUTBOUND_HOSTNAME=auto 2026-11-15 23:47:04 -04:00
CONTRIBUTING.md Docs: bring the guides up to date with the code and with what was tested 2026-11-14 14:38:26 -04:00
coveralls.json feat: Karta's own components for the admin pages: states, panels, tables, copy buttons, DNS records, charts 2026-11-08 23:52:59 -04:00
Dockerfile Fix the installation walk-through: stale statements and missing steps 2026-11-12 01:32:00 -04:00
LICENSE Karta: initial import 2026-11-07 01:56:31 -04:00
mix.exs Use the canonical Karta small icon and clear the dependency audit 2026-11-19 08:11:57 -04:00
mix.lock Use the canonical Karta small icon and clear the dependency audit 2026-11-19 08:11:57 -04:00
README.md Docs: bring the guides up to date with the code and with what was tested 2026-11-14 14:38:26 -04:00
SECURITY.md Docs: bring the guides up to date with the code and with what was tested 2026-11-14 14:38:26 -04:00

Karta

KAR-tah — Papiamentu for letter.

Karta is a mail platform: an SMTP server and client, a delivery queue, and HTTP APIs for sending mail. It is written in Elixir on Phoenix and Postgres and is meant to be run by a team that wants to own its mail path without running a large legacy MTA. It is a rewrite of Postal.

What it does today:

  • Accepts mail from applications over SMTP submission (587 and 465, AUTH PLAIN, LOGIN and SCRAM-SHA-256 over TLS, or an address range credential for a client whose address is known) and over five HTTP APIs: its own (/api/v2, with an OpenAPI 3.1 document) and APIs compatible with Postal (/api/v1), Mailgun (/mailgun/v3), SendGrid (/sendgrid/v3) and Postmark (/postmark), so existing clients and framework adapters work by changing a base URL and a key. Messages can carry tags and variables, be scheduled up to 72 hours ahead, switch tracking off, and go out in batches of one message per recipient.
  • Sends only from verified domains, checked on parsed addresses; a domain is verified by a TXT record its owner publishes, and its DNS records (SPF, DKIM, DMARC, MX, reverse DNS, MTA-STS, TLS-RPT, BIMI) are checked every hour, with what to change. DKIM keys are rotated with dual publication; Karta serves domains' MTA-STS policies and BIMI logos (SVG Tiny PS, checked) and can publish its own records through PowerDNS, RFC 2136 dynamic update or a provider of its own.
  • Stores message bodies encrypted in S3-compatible storage; keeps secrets hashed or encrypted at rest.
  • Receives mail for the addresses that servers route on their verified domains, and passes it on to an application over HTTP (Karta's JSON, the raw message, Postal's two formats, or a Mailgun, SendGrid or Postmark inbound post), to another mail server, or as a forward with SRS and an ARC seal, signed or with an extra header of the organisation's choosing; checks SPF, DKIM, DMARC and ARC and refuses forged senders of domains that ask for it, unless a trusted forwarder vouches for them; refused at SMTP time, never bounced later.
  • Delivers with DKIM (Ed25519 and RSA), opportunistic or verified TLS, the recipient domains' MTA-STS policies and DANE records, REQUIRETLS, IP pools (sending addresses that may move between the nodes of a cluster, each with its own HELO name and warm-up plan), limits per destination, retries for 5 days, delivery records, suppression lists, delivery status notifications, and open and click tracking with one-click unsubscribe, on the sending domain's own tracking host if it has one.
  • Sends webhooks of what happens to messages (accepted, delivered, deferred, bounced, opened, clicked, unsubscribed) and of DNS problems, signed as Standard Webhooks or in Postal's, Mailgun's, SendGrid's or Postmark's format (Postal's with a key of the organisation's own, so one organisation's requests do not verify with another's), or with an extra header of the organisation's choosing beside the signature; retried for three days and replayable; never to private or special addresses. Applications can manage them with Mailgun's and SendGrid's webhook APIs too.

It also receives and sends the reports mail depends on: DMARC aggregate and failure reports and TLS reports are read, and DMARC aggregate and TLS reports are sent.

Status

Version 1.0.0, the first release (13 November 2026). The features above are built and tested, were checked by hand on the authors' deployment before the release, and CI runs the whole suite and a dependency scan on every change. Karta has been run on one staging deployment of its authors only: it has sent mail since 8 November 2026 and has received mail for one test domain since 11 November 2026 (scanned for spam and viruses since 12 November). It has not carried production mail for third parties, and nobody outside its authors has run it yet, so read the Security model and the installation guide before putting real mail through it, and expect rough edges. What is missing and what is planned for 1.1 is in Status and roadmap; what changed is in CHANGELOG.md. The optional, off-by-default messaging module (SMS and WhatsApp) is not proven end to end and is not a stable interface: see The messaging module.

Documentation

The documentation is in guides/ and is built into a site with the module reference and the OpenAPI document:

mix docs        # output in doc/; open doc/index.html

Start with:

Quick start

Requirements: Elixir 1.20.5 on Erlang/OTP 29.1.2 (.tool-versions, for mise or asdf), Docker with Compose.

# Local services: Postgres, a validating Unbound with signed test zones,
# Mailpit, rspamd, ClamAV, Garage (S3). See dev/README.md.
docker compose -f dev/compose.yml up -d
dev/garage-bootstrap.sh

mix setup                  # deps, database, assets
iex -S mix phx.server      # http://localhost:4000, /health, metrics on :9568
mix precommit              # format, compile, credo, sobelow, audits, tests

Tests run against the compose Postgres (host port 55433). The Local development guide continues from here to a first message in Mailpit.

Container image

docker build -t karta .
# once, and after every upgrade (the server does not migrate):
docker run --rm --read-only --tmpfs /tmp --env-file karta.env karta /app/bin/migrate
docker run --rm --read-only --tmpfs /tmp -p 4000:4000 --env-file karta.env karta

karta.env holds at least SECRET_KEY_BASE, DATABASE_URL, KARTA_VAULT_KEY and PHX_HOST; a useful installation also needs the message store (KARTA_S3_*), a validating DNS resolver (KARTA_DNS_SERVER), the SMTP listeners and a way to sign in. The installation guide walks through them; deploy/examples/ has Docker Compose and Kubernetes examples for several replicas.

The image runs as an unprivileged user (uid 10001) from a read-only root. KARTA_VAULT_KEY is the base64 of 32 random bytes (openssl rand -base64 32) and encrypts secrets at rest; losing it loses them. See Installation.

Contributing and security

See CONTRIBUTING.md and SECURITY.md.

License

MIT, Copyright (c) 2026 Shiloh B.V. See LICENSE.