Changelog

All notable changes to Karta are recorded here. The format follows Keep a Changelog; every security fix appears under Security with the advisory it closes (see SECURITY.md).

Unreleased (still 1.0)

Changes after the release keep the version 1.0.0 and are listed here until the next planned release.

Added

  • Integration contracts: Driving Karta from your own system gathers how an outside provisioning, billing or sign-up system authenticates, which calls it makes, the lifecycle, errors, retries and what is not available yet; the Provisioning API guide gains the suspension reason limit and the list shape.

  • Review fixes for the messaging module: the messaging event names are not accepted or listed by the v2 API while the module is off; the text of a received message stays out of webhook events unless the server asks for it; JSON bodies are limited to 1 MB except the media upload; a late report about an earlier attempt cannot start a second duplicate; requests left behind by a crash are moved on; SMS has a daily cap in segments (50 when none is set) and a list of countries; waiting is bounded; Bird is never followed to another address, a duplicate SMS needs proof that the first was not accepted, money is kept as decimals.

  • Routing and guard rails for the messaging module: an ordered channel list per message that moves on only on facts (the agent offline longer than wait_for_connector_s, the number not on the channel, a permanent failure, three tries of a failure that sent nothing), never on a missing delivery receipt unless the request sets fallback_after_s, and stops and reports when nobody can tell whether a message went out; the answer and the events always name the channel used, the attempt, the cost and a possible duplicate; SMS only when the server, the request and the organisation's daily cap allow it, with a segment estimate; no WhatsApp first contact without a stated reason; quiet hours; send limits across replicas (Routing and guard rails).

  • SMS through Bird for the messaging module (bird_sms plug): sending with an idempotency key, delivery reports and inbound texts by signed webhook (/messaging/v1/hooks/:connector_id), Bird's errors mapped to Karta's classes, sender-id rules, numbers normalised to E.164 with the server's country (Bonaire, Curaçao, Aruba, Sint Maarten, the Netherlands), the cost per message, a connector that pauses itself on an empty wallet or a refused key (SMS through Bird, SMS acceptance).

  • The messaging module (/messaging/v1), optional and off unless KARTA_MESSAGING=1: conversations over WhatsApp and SMS, kept in Karta (connectors, conversations, messages, files), sent and read through an HTTP API with an idempotency key, announced by signed webhook events (messaging.message.received, .status, .connector.*, which a webhook receives only when it names them: a webhook with no event list gets none), an agent connection for Postduif, the WhatsApp agent for a shop's computer (postduif.v1: one-time code enrolment, a key proof on connect, commands with acknowledgements, events with cursors applied exactly once, resume, several replicas with or without KARTA_CLUSTER), console pages (connectors, an archive of conversations searched by number, settings), a per-organisation retention (default 730 days, KARTA_MESSAGING_RETENTION_DAYS; sign-in codes 7 days at most), messages encrypted at rest, metrics and guides (The messaging module). With the module off Karta behaves as before: unknown routes, no menu entries, no job, no metric; the migration only adds new tables. New API key scopes messaging:send, messaging:read and messaging:manage exist only while the module is on.

  • GET /health and the account page of the console show the running version (the security policy asked reporters for it and the answer had none).

Changed

  • The "We can't find the internet" and "Something went wrong" notices of the console wait 3 seconds before they show, and the wait restarts when the page becomes visible again, so switching to another app on a phone and back no longer flashes them.
  • A domain with no DKIM key says that its mail goes out unsigned and where to generate one; the report-sending page says "Not set" (not "Failed") when no reporting identity is configured.
  • A DNS lookup that failed is described in words ("failed (timed out)") instead of as an Elixir atom ("failed (:timeout)") in the domain health findings and the MTA-STS probe.
  • A browser that asks for a page that does not exist, or one that fails, gets a small page with a way back; clients that do not ask for HTML keep the plain Not Found.

1.0.0 — 2026-11-13

The first release. Everything below was built before it and checked by hand on the authors' staging deployment (see Status in the README): the entries of the release candidate (1.0.0-rc.1, 12 November) and what the last checks changed. It is not published to a public registry by this entry. Karta has run on one staging deployment of its authors.

Fixed

  • The raw sends (POST /api/v2/messages/raw, POST /kantoor/v1/messages/raw) took a body of at most 8,000,000 bytes, so a message over about 6 MB could not be submitted although SMTP takes 25 MiB. These two paths now take 37,049,688 bytes (a 25 MiB message as base64 and 2 MiB for the rest); every other JSON body keeps the 8,000,000 limit. A raw message larger than 25 MiB decoded is refused with 422 message_too_large (also by the Postal and Mailgun-compatible sends, which had no size check). The Kantoor paths (/kantoor/...) were also read by the browser pages' parser, before the key was checked and with Plug's limit; they are now left unread until the API pipeline has checked the key, as the other API paths are.

Added

  • KARTA_SMTP_SUBMISSION_TRUSTED_PROXIES: the submission listeners' own trusted proxies (empty: none). KARTA_SMTP_TRUSTED_PROXIES applied to every listener, so a deployment whose port 25 comes in through a relay with the PROXY protocol could not also let an application on the same host submit mail directly.

  • A received message's page in the admin interface has a "Scan" panel: the spam score, rspamd's action and symbols, the virus result, or why a scanner did not answer.

  • A message the scan refuses (spam, virus, or a scanner that could not answer) is logged with the sender's address and what the scanners said, and so is one accepted unscanned because every route is open. Nothing is stored for a refused message, so the log was the only place this could be seen.

  • Replicas find each other through the database: KARTA_CLUSTER=true starts the libcluster_postgres strategy (our fork, a git dependency; LIBCLUSTER_POSTGRES_PATH uses a checkout) on KARTA_CLUSTER_DATABASE_URL (default DATABASE_URL; required behind a pooler). bin/server names the node, takes the cookie, fixes the distribution port (KARTA_DIST_PORT) and binds it and epmd to the replica's address. dev/replicas/run.sh runs three replicas on one machine (dev/replicas/run-in-docker.sh in Docker, for a machine without Elixir) and checks the burst, the kill, the roll and the claims, clustered, unclustered and with the cluster cut on purpose.

  • Several replicas: a guide ("Running several replicas") that lists what each replica keeps in memory and what happens with N, what a replica that is stopped (SIGTERM drains running deliveries) or killed leaves behind, and Kubernetes and Docker Compose examples in deploy/examples/. KARTA_CLUSTER=true lets replicas find each other through the database (KARTA_CLUSTER_DATABASE_URL for a direct connection behind a pooler); it replaces DNS_CLUSTER_QUERY and is optional: nothing depends on it.

  • Karta.Relay: live updates of the admin pages, the route cache's reload and the disconnect of a signed-out user's pages reach every replica through the database, with or without a cluster. A new inbound route used to reach the other replicas' mx listeners only at their next minute reload (measured: up to 37 seconds); it now takes under a second.

  • With the replicas in a cluster, each counts its share of a destination's connections and per_minute limits.

  • The Grafana dashboard and the webhook alert aggregate the gauges read from the database with max instead of sum, so the number does not grow with the replicas.

  • DSN (RFC 3461: NOTIFY, ORCPT, RET, ENVID) is offered on the submission listeners, where Karta delivers the mail and writes the notifications (KARTA_SMTP_DSN=false turns it off); the mx listener never offers it. REQUIRETLS is available over /api/v2 as require_tls, for a message built from its parts, given whole and in a batch.

  • DKIM keys can be rotated on a schedule: KARTA_DKIM_ROTATE_AFTER_DAYS rotates an active key that has signed that long, in the domains whose zone Karta publishes. The waits of a rotation are unchanged (the new record seen for an hour, the TTL of the records, before it signs; the old record kept a week).

  • GET /livez (the node runs; asks nothing of any dependency) and GET /readyz (the database, the blob store and the spool directory answer; each check has two seconds and says which failed), so that an orchestrator restarts on the first and takes a node out of rotation on the second. GET /health is unchanged. KARTA_LOG_FORMAT=json writes logs as one JSON object a line. The guide describes a two-node cluster (node names, cookie, ports, DNS_CLUSTER_QUERY).

  • Actions on an outgoing message that is still to be delivered, on its page and over /api/v2 (scope messages:manage): try again now, hold, release and cancel a scheduled message. Each is judged recipient by recipient, never touches a recipient that is delivered, bounced, suppressed or cancelled, and says why when it has nothing to act on. A held recipient is not taken by any node and is not queued again by the sweeper; retrying does not interrupt a delivery in progress. Who did what is kept in an audit log (Karta.Audit) and shown on the message page. A recipient has the new status cancelled and, while held, held.

  • Report summaries under the organisation's Reports: the DMARC aggregate reports and the TLS reports added up over the last 7, 30 or 90 days. For DMARC, the messages reported, how many passed SPF and DKIM, what receivers did with them, by domain and by reporter, and the days with failures; for TLS, the sessions that succeeded and failed, by domain and by reporter, and the most frequent failure reasons. At most the latest 20,000 reports of a kind are read, and the page says when there were more. The Report sending page adds up what Karta sent in the last 30 days, by run state, with the reasons runs were skipped or failed.

  • TLS reports are sent (RFC 8460): the same reporting identity, daily plan, limits and retries as for DMARC reports. For each domain Karta sent mail to, from the sessions it recorded, a report of the policies that applied, the successes and failures and up to 1,000 failure details, to the mailto: addresses of the domain's _smtp._tls record. KARTA_REPORTS_TLS_RPT=false switches it off.

  • DMARC aggregate reports are sent (RFC 7489 §7.2): once an instance has a reporting identity (KARTA_REPORTS_FROM, KARTA_REPORTS_SERVER), Karta reports every day, to each domain whose mail it accepted, the source addresses and the SPF and DKIM results, to the rua addresses of the domain's DMARC record. A destination outside the domain's organisation must agree with a _report._dmarc record (§7.1). A report is split at 2,000 records, an address receives at most 100 reports in 24 hours, and a run is retried and taken by one node at a time. Mail refused at SMTP time is not in a report, and failure reports are not sent. Instance administrators see the identity, its problem if there is one, and the latest runs under Report sending. The report is validated against the schema of RFC 7489 Appendix C by a test.

  • DMARC failure reports (RFC 7489 §7.3) and TLS-RPT reports (RFC 8460) are received at a route whose mode is report, beside aggregate reports. A failure report keeps the reporter's fields about the failure and the quoted message's Message-ID, not the quoted message; a TLS report keeps its policies, session counts and up to 1,000 failure details, within bounds, and is refused with more than 200 policies. Each is attributed to a verified domain of the organisation or to none, and recorded once. The Reports page lists them with their kind and each report's page shows what is particular to it.

  • The optional mailbox interface (/kantoor/v1; guide: The Kantoor interface), for a webmail or mail store that keeps its own index and uses Karta as its mail store (Kantoor is the first user). It is off unless KARTA_KANTOOR is 1 or true at run time; while it is off every /kantoor/v1 path is an unknown route, and no part of the feature runs. It adds Kantoor keys (API keys marked for it, with optional domain and mailbox restrictions, accepted nowhere else) and the scopes messages:list, messages:delete, messages:raw and domains:read; health, the available domains, the raw message with Range and HEAD (only the encrypted chunks that hold a range are read), a cursor listing, deletion per delivery with reference counting, and sending with a retention and a source. Retention policies (keep or days) on deliveries, routes and sent messages, set by an endpoint's answer to a push; keep is exempt from the size cap, with an optional per-server cap on kept storage and metrics. HTTP endpoints may be notify-only (the push has no raw).

  • DMARC aggregate reports are received: a route whose mode is report keeps what arrives at its address, and Karta reads the report in it — the XML itself, a gzip stream or one zip archive, within a bound and read with no document type declaration or entity. A report is attributed to a verified domain of the organisation, or to none, is recorded once, and is never trusted for anything. The organisation's Reports page lists the reports received and a report's page shows its records; reports are kept for 90 days.

  • A mailbox can now attach itself through the interface: POST /kantoor/v1/endpoints registers its karta-format HTTP endpoint (https: and an address Karta may connect to, marked for Kantoor, optionally notify-only, idempotent by name, owned by the key that registers it, secret shown once) and POST /kantoor/v1/routes creates the route for an address or a whole domain to it. Both need routes:write, stay on the key's server, and are limited to the organisation's verified domains and the key's allowed_domains / allowed_mailboxes; a route may point only at a Kantoor endpoint, and an existing route is a 409 unless the request takes it over and it already points at that endpoint. GET /kantoor/v1/messages/:id (scope messages:read) returns one message's metadata in the list's shape.

  • The push of a received message in Karta's format carries authentication: what Karta found out about the sender (SPF, DKIM, DMARC, ARC), as the inbound API shows it, or null.

  • The mail metrics: what happened to each outgoing recipient (delivered, deferred or bounced, with the enhanced status class and the reply code) and the TLS it went over; the SMTP listeners' refusals by code and class, their connections and their authentication attempts; the SPF, DKIM and DMARC results of received mail; the spam and virus scan's result and latency; each DNS lookup (from the cache, from the resolver, or failed); each webhook request; each bounce and complaint; and, read from the database every 30 seconds, the outgoing queue per server and queue with the age of the oldest due recipient, the inbound deliveries pending and held, the webhook deliveries pending and failed, and the addresses each server suppresses (Karta.Metrics, Karta.Metrics.Report, Karta.PromEx.Mail). A server is labelled by its id, never by a name or a domain, and a value from outside the fixed label vocabulary is other. A Grafana dashboard (priv/grafana/karta-mail.json) and six alert rules in PromQL (priv/prometheus/karta-mail-alerts.yml) are in the repository.

  • The instance's admin pages for IP pools: IP pools lists the pools and adds one, and a pool's page has its addresses (address and HELO name, family, whether the node serving the page holds it, warm-up progress), its settings, the mail servers that send from it, and the actions to add and remove an address (with the PTR and address records checked, or without the check while they are set up), change its settings, assign a mail server to it and back, start and end a warm-up, and remove the pool; Warm-up plans adds, changes and removes the plans. Both are for instance administrators, and both read what they show again every five seconds.

  • The server overview's Usage panel: the messages it sent and received each UTC day for the last 14 days, and how many deliveries of the last minute count against its sending limit (Karta.Messages.daily_counts/3, Karta.Outbound.recent_delivery_count/3, which the limit itself now counts with). No counter table.

  • Sending a stored message in pieces: a delivery reads the body from the blob store once for what it needs (its size, its 8-bit content, whether its lines end with CRLF, the canonical body hash a DKIM signature covers) and then once per address it is sent to, chunk by chunk, instead of holding the message and three more copies of it. Karta.Storage decrypts and authenticates each chunk before its plaintext is used, and reads the store in pieces as well (a local file in 64 KiB pieces, an S3-compatible object in ranges), so a damaged body is an error and never a shorter message. Dot-stuffing and the check for bare line endings are done on those chunks, with the same bytes on the wire. Ten deliveries of one 25 MiB message at once cost about 1 MiB per delivery instead of about 135 MiB; the harness is test/karta/outbound/memory_test.exs (KARTA_TEST_MEMORY=1). The body hash of a DKIM signature is computed as the body arrives, which also makes checking the signatures of received mail cheaper.

  • Spam and virus scanning of received mail before the reply to DATA (Karta.Scan): rspamd's HTTP API for the score, its action and its symbols, and clamd's INSTREAM for viruses, with the spool file streamed in chunks and never read into memory. Both are bounded by one time budget and a size, and a scanner that does not answer inside them counts as failed. What they said is kept with the message (messages.scan), added as X-Spam-* and X-Virus-* fields, shown by the API and reported by the formats that carry it (Postal's spam_status, SendGrid's spam_score and spam_report). A virus refuses the message (554 5.7.1). Routes choose what spam does (spam_mode mark, hold or reject), from which score (spam_threshold) and whether a scanner that cannot answer refuses the message (fail_closed, 451 4.7.1); spam a route holds is stored with held deliveries, released with POST /api/v2/inbound/messages/{id}/release or on the message page. A route that holds mail now has an endpoint, which is where a released message is delivered.

  • The admin pages for receiving mail and suppressions. A server's Routes page lists the addresses it receives and what happens to their mail, and lets owners and admins add a route for a verified domain of the organisation (to an endpoint, stored, stored and held, or refused, with plus addressing and the DMARC refusal) and change or remove it. Its Endpoints page lists where received mail goes (an application's URL in Karta's, raw, Postal's, Mailgun's, SendGrid's or Postmark's format; an SMTP relay; forwarding addresses) and lets them add one, change it, remove it while no route uses it, and set an extra authentication header; an HTTP endpoint's signing secret is shown once, and a URL's password is never shown. Its Received page lists the messages it received, with each delivery's state, attempts and last answer, and lets members and above send a waiting or failed delivery again; a received message shows its envelope, its deliveries and its content. Its Suppressions page lists the addresses it does not send to, searched by the start of the address and by reason, and lets members and above add and remove one. All four are live. Routes, endpoints, received deliveries and suppressions are announced, so open pages read them again.

  • IP-authenticated SMTP relay (Karta.SMTP.Relay): a server may hold IP range credentials (kind: "ip", /api/v2/credentials, the credentials page) naming a CIDR range of client addresses that send through the server without AUTH. A range is stored in canonical form and may be at most as wide as the instance allows (KARTA_SMTP_IP_MIN_PREFIX_V4, default /16; KARTA_SMTP_IP_MIN_PREFIX_V6, default /48); 0.0.0.0/0 and ::/0 are never accepted. A client in a range sends only from the server's organisation's verified domains, under the range's rate limit and its server's suspension, and with tls_required (the default) only over TLS. The most specific range wins when ranges of two servers overlap; two active credentials cannot name the same range. Ranges are accepted on the submission listeners, and on the mx listener only with KARTA_SMTP_MX_IP_RELAY=true. The address is the connection's peer (or the PROXY header of a trusted proxy), never anything in a message. An accepted message keeps relay_credential_id (the message API, the message page) and is logged without a secret.

  • Bounces of sent mail (Karta.Bounces): with KARTA_RETURN_PATH_DOMAIN set, the mx listener accepts the delivery status notifications that come back to each recipient's VERP return path (Karta.Outbound.ReturnPath), when the tag is one Karta made and it is no older than KARTA_BOUNCE_MAX_AGE_DAYS (default 30); an invalid or expired one is refused with 550. A notification is read as RFC 3464's message/delivery-status (or from the text of the bounces some systems send), matched to the recipient its return path names, recorded (bounces) as a delivery attempt and emitted as message.bounced or message.deferred; a permanent failure puts the address on the server's suppression list unless it is a 5.7.x policy rejection. A receiving server's permanent refusal during delivery does the same. The same report delivered twice is recorded once, and nothing is sent in reply.

  • Complaints (Karta.Complaints): a feedback report (RFC 5965) that comes back to a recipient's VERP return path is read (its message/feedback-report part, bounded as bounces are: 10 levels, 50 parts, 64 KiB, 100 fields), matched to the recipient the return path names — never to an address the report gives — recorded (complaints) and emitted as message.complained in every webhook format (complained in Mailgun's, MessageSpamComplaint in Postal's, spamreport in SendGrid's, SpamComplaint in Postmark's). The address is suppressed with the reason complaint, which outranks a bounce, an unsubscribe and an entry added by hand; a not-spam report suppresses nothing. The same report delivered twice is recorded once, and nothing is sent to the reporter. Mailgun's webhooks API serves complained, and SendGrid's spam_report switch and Postmark's SpamComplaint record are available.

  • A suppression policy for each server (Karta.Suppressions.Policy): after how many temporary failures within a window an address is suppressed by itself (hard_bounce, source soft_bounce_policy), and how many days an entry of each reason (hard_bounce, complaint, unsubscribe, manual) lasts. Off and never by default. Changed on the server's settings page and with GET and PUT /api/v2/suppression-policy; the expiry is set when an entry is added, an expired entry stays on the list and no longer counts, and Mailgun's and SendGrid's suppression lists show only the entries that still count.

  • A Postmark-compatible API under /postmark (KartaWeb.Postmark), with the server token in X-Postmark-Server-Token (never in the query string) and Postmark's errors (ErrorCode, Message, the X-PM-ApiErrorCode header): POST /email (From, To, Cc, Bcc, ReplyTo, Subject, TextBody, HtmlBody, Headers, Attachments with inline parts, Tag, Metadata, TrackOpens, TrackLinks, MessageStream outbound; at most 50 recipients and 10 MiB) and POST /email/batch (up to the batch limit and 50 MiB, each checked on its own and answered per message as Postmark answers, the valid ones stored together); the messages API for outbound messages (search, details with events, dump) and the bounce API (delivery stats, bounces, a bounce, its dump), read from the server's own messages; templates refused (1101). Postmark's official Ruby client and Swoosh's Postmark adapter are tested against it. Karta.Sending.send_each/3 sends several messages each on its own, and Karta.Sending takes addresses already parsed (Karta.Mail.Address); Karta.Sending.Options.text_variables/2 checks variables given as text with an API's limits; Karta.Mail.Text holds small shared checks of text; Karta.MessageEvents.list/2 takes message, one message's id; Karta.Postmark reads messages and bounces as Postmark's APIs do.

  • The parsed inbound formats of HTTP endpoints: Postal's Hash (postal_hash), a Mailgun route's forward() post (mailgun, with a signing key per endpoint, as Mailgun signs with timestamp and token), SendGrid's Inbound Parse with the raw message (sendgrid) and Postmark's inbound webhook with the raw message (postmark). One MIME-to-fields mapping (Karta.Inbound.MailFields) reads a message for all of them, and the request bodies are encoded as the provider encodes them (Karta.Inbound.Encoding: Ruby's Base64.encode64 lines, URI.encode_www_form form data, and multipart/form-data). A message that cannot be parsed fails its delivery with the reason, and nothing is posted. messages.received_tls records whether a message was received over TLS, for Postal's received_with_ssl.

  • A received message's attachments are decoded only for the formats that send them (Karta.Mail.Message.summary/2 takes attachments: false).

  • DNS providers behind one behaviour (Karta.DNS.Provider): Karta publishes its own records of verified domains (the ownership record, the DKIM keys' records, the tracking host's CNAME, and the MTA-STS, TLS-RPT and BIMI records it serves) through the provider KARTA_DNS_PROVIDER selects. Karta.PowerDNS (the default) keeps its API and its comments; Karta.RFC2136 adds dynamic update (RFC 2136) with TSIG signed with HMAC-SHA256 or HMAC-SHA512, prerequisites that refuse a stale change, checked answers and a TCP fallback, for BIND, Knot, PowerDNS and other authoritative servers. A Hex package compiled into the image with the build-time KARTA_EXTRA_DEPS file adds another provider; Karta loads no provider code at run time. A guide on writing one sits under Domains and DNS. The domain's page says which provider publishes, and the records to publish by hand stay where no provider is configured.

  • Postal-format signing keys belong to one organisation each (Karta.Webhooks.PostalKey): made when first needed (RSA, 2,048 bits), encrypted by the vault, rotated per organisation (in a release command or on a webhook's page) and published at the organisation's own JWK set, whose address holds an unguessable token. X-Postal-Signature-KID names the organisation's key, and a request signed for one organisation does not verify with another's key. GET /api/v2/postal-key shows the key's public parts.

  • An extra authentication header for webhooks and inbound HTTP endpoints (Karta.RequestAuth): a header of the owner's choosing with a secret value, for a receiver that cannot check a signature. It is sent beside the format's signature, never instead of it; its name must be an HTTP token and not one the request or a signature needs; its value is printable ASCII, kept encrypted by the vault, and shown once. It is set, changed and removed over the API (auth_header, auth_header_value, auth_header_remove) and on a webhook's page.

  • Checking the senders of received mail (Karta.Auth): SPF (Karta.Auth.SPF, RFC 7208: every mechanism, modifier and macro, the limits of 10 DNS-querying terms, 2 void lookups and 10 MX or PTR names, for the MAIL FROM and HELO identities; checked against the SPF project's RFC 7208 test suite, vendored under test/fixtures/spf), every DKIM signature, and DMARC (Karta.Auth.DMARC, RFC 9989: policy discovery and organisational domains by the DNS tree walk, at most 8 queries per name, psd, p/sp/np, test mode, strict and relaxed alignment; no public suffix counts as an organisational domain), all within 20 seconds per message. The mx listener stores received mail with an Authentication-Results: field (RFC 8601) under its authserv-id (KARTA_AUTHSERV_ID, default the listener's host name), removes arriving fields that claim that id, keeps the results with the message (messages.auth_results) and refuses mail that fails DMARC for a domain whose policy is reject, or names more than five author domains, with 550 5.7.1 when every recipient's route has dmarc_reject (default true). A temporary error never refuses mail. Over the API, routes have dmarc_reject and received messages authentication.

  • ARC (RFC 8617) for received mail: Karta.Auth.ARC validates the chain (at most 50 sets, each key looked up once, every error a fail; checked against ValiMail's ARC test suite and dkimpy's ARC tests, vendored under test/fixtures/arc), reported as arc= in the Authentication-Results: field and in authentication.arc; a DMARC failure is accepted when the newest set's sealer is one of KARTA_ARC_TRUSTED_SEALERS (none by default) and its results say DMARC passed (override: arc). Karta.Auth.ARC.Sealer adds ARC sets; forwards of received mail are sealed with the receiving domain's RSA DKIM key (Karta.Inbound.Seal), with Karta's results of the original message. DKIM verification takes a deadline, and the checks of a message stop when its connection is gone. Karta.Storage.put/3 takes iodata without joining it. The dkimpy development image is now karta-dev-dkimpy:2 (with dkimpy's ARC tools).

  • Receiving mail (Karta.Inbound): routes of a server (Karta.Inbound.Route) on the verified domains of its organisation only (an address, *, plus addressing; modes endpoint, accept, hold, reject; no bounce mode), and endpoints (Karta.Inbound.Endpoint): HTTP in Karta's JSON, the raw message or Postal's RawMessage (JSON or form data, signed with the instance's Postal key, as Postal encodes it), with Standard Webhooks signatures for Karta's formats and Basic authentication from the URL; SMTP relays with opportunistic, required or verified TLS; forwarding to up to ten addresses; one forward, or one relay transaction, per message and endpoint, for all the recipients routed there. The mx listener's policy Karta.SMTP.Policy.Inbound: RCPT answered from the routes in memory (Karta.Inbound.Directory, reloaded every minute and on every node when a route changes, Karta.Inbound.Refresher; 451 4.3.2 until loaded), one server per message (452 4.5.3), a loop guard (Received: hops, Delivered-To:; 554 5.4.6), and a delivery per recipient (Karta.Inbound.Delivery) accepted with the message. Deliveries to endpoints (Karta.Inbound.Dispatcher, Oban queue inbound, KARTA_INBOUND_CONCURRENCY) through the NetGuard, retried for three days; no bounce is ever sent for received mail. Forwards are outgoing messages with an SRS sender (Karta.Inbound.SRS: SRS0 and SRS1 under the vault key, KARTA_SRS_DOMAIN) and Delivered-To:, without tracking or delivery status notifications; bounces to an SRS address are checked at RCPT, accepted and dropped. /api/v2/endpoints, /api/v2/routes and /api/v2/inbound/messages/{id}, with the scopes routes:read and routes:write. KARTA_INBOUND_ALLOW_HTTP.

  • Message options over the v2 API (KartaWeb.API.V2.SendParams): tags, variables (text values), send_at (an RFC 3339 time, at most 72 hours ahead) and track_opens/track_clicks (off for one message) on POST /api/v2/messages and /api/v2/messages/raw; a message read back has tags, variables, send_at, track_opens and track_clicks, and a send answer the send_at. Tags and variables reach the webhooks of every format as the other APIs' do.

  • Batches over the v2 API (POST /api/v2/messages/batch, operation sendBatch): one message per recipient (1 to 1000) with its own Message-ID, {{name}} replacements in the subject, text and HTML (KartaWeb.API.V2.Replacements: plain, in one pass, escaped in the HTML, no line break into the subject) and variables of its own; all checked before any is stored, at most 50 MiB of content together.

  • Karta.Sending takes :now, the time a send_at is judged against; a batch reads the clock once for all its messages.

  • Milestone 0 (Foundations): Phoenix 1.8 application on Elixir 1.20.5 / OTP 29.1.2; mix precommit quality gate (format, compile with warnings as errors, credo, sobelow, hex.audit, deps.audit, tests with coverage); development stack (Postgres, validating Unbound with signed test zones, Mailpit, rspamd, ClamAV, Garage); organisations, users, memberships and servers; AES-256-GCM vault (Karta.Crypto, no Cloak) for secrets at rest; /health; Prometheus metrics on port 9568; Bugsink (Sentry protocol) error reporting; hardened Docker image and Woodpecker CI with dependency and image scanning.

  • Mail core and storage: a strict RFC 5322/6532 parser for addresses in header fields (a comment cannot choose the domain a message is checked against) and an author-domain check built on it; header blocks split byte for byte, with size limits; MIME parsing and building in pure Elixir; a sanitised Received: field; message bodies encrypted at rest (chunked AES-256-GCM, a key per message) in an S3-compatible store; a message table and an SMTP intake that acknowledges a message only after its body and its row are stored; retention by age and by size.

  • DNS client and DKIM: a DNS client in pure Elixir (EDNS(0) with the DO bit, the AD bit reported, A, AAAA, MX, TXT, CNAME, PTR, NS, SOA, TLSA and CAA, strict bounds on everything it decodes) that asks a local validating resolver over UDP with a fallback to TCP, and a bounded TTL cache with negative caching; DKIM signing with RSA-SHA256 (2048 to 4096-bit keys) and Ed25519-SHA256, dual signatures, oversigned header fields and no l=; DKIM verification on the received bytes (RFC 6376, RFC 8463, RFC 8301), checked against the RFC test vectors and against dkimpy; DKIM keys encrypted at rest. The development resolver knows only the test zones.

  • Outbound delivery: a job queue on Postgres (Oban) with one delivery job per message and recipient domain, queued in the same transaction that accepts a submitted message; MX resolution (RFC 5321 §5.1, null MX, implicit MX, address literals) with an IPv4/IPv6 policy and blocked address ranges; an SMTP client with bounded replies and connect, read and write timeouts, opportunistic TLS by default and verified TLS per domain; per-recipient delivery state and an attempt log written after every attempt; retries for 5 days with growing delays; a server's send limit delays mail instead of holding it; VERP return paths; delivery status notifications (RFC 3464, RFC 6533) to the submitter; a message that needs SMTPUTF8 is bounced with 5.6.7 when the receiving server lacks it (RFC 6531); messages waiting for delivery are kept by retention; a seam for DKIM signing at delivery time.

  • Submission and credentials: domains of organisations, verified by an operator for now, at most one organisation per domain name; DKIM keys generated per domain (Ed25519 and RSA), encrypted at rest, activated one per algorithm, and used to sign outgoing mail only from verified domains; API keys with scopes, kept as Argon2id hashes behind an 8-character lookup prefix; SMTP credentials kept only as SCRAM-SHA-256 keys, which check AUTH PLAIN and LOGIN as well; SCRAM-SHA-256 in the SMTP session (RFC 5802, RFC 7677; checked against the RFC test vector); a submission policy that sends only from the server's verified domains (From, Sender and the envelope sender, on parsed addresses) with a rate limit per credential; a periodic sweep that queues delivery again for recipients whose delivery job was discarded.

  • Sending APIs: Postal's sending API (/api/v1: send a message built from its parts or given whole, read a message and its delivery attempts; Postal's JSON, error codes and request specs) and Karta's own /api/v2 (sending, message status and delivery attempts, credentials, the suppression list) with an OpenAPI 3.1 document at /api/v2/openapi.json; API keys with a short-lived cache of verified keys, scopes per action, a rate limit per key and a limit on key verifications per client address; messages sent over HTTP are authorised (From, Sender and the envelope sender, on parsed addresses) and stored like SMTP submissions; a suppression list per server, whose recipients are recorded but never delivered to, over SMTP and HTTP alike; ids that are malformed or belong to another server are simply not found, and no endpoint fetches a URL (both with regression tests).

  • Tracking and one-click unsubscribe, each turned on per server: links in HTML parts rewritten and an open pixel added for each recipient before the message is signed; List-Unsubscribe and List-Unsubscribe-Post (RFC 8058), covered by the DKIM signature; a tracking host on a listener of its own that serves only the pixel, a redirect to the URL stored when the message was sent, and the unsubscribe page and one-click POST (which adds the address to the server's suppression list); tokens signed with a key derived from the vault key, working across vault key rotation; the client's network and user agent kept with each open and click and deleted with the message; opens and clicks in Postal's activity_entries and at /api/v2/messages/{id}/events.

  • A Mailgun-compatible API at /mailgun/v3, so that Mailgun's clients and adapters work by changing the base URL and the key: sending (messages, with attachments, inline images, headers, variables, tags, scheduled delivery, per-message tracking switches and batches with recipient variables; messages.mime); the bounces, unsubscribes and complaints lists on the server's suppression list; the events API from Karta's own records, with signed paging links built from Karta's own URL. Options Karta cannot honour (stored templates, test mode, required TLS, archiving to a URL) are refused, not ignored. Checked with Mailgun's official Ruby client in a container, with Swoosh's Mailgun adapter, and against the examples of Mailgun's API reference.

  • Messages keep their tags and variables, may be scheduled up to 72 hours ahead, and may switch open and click tracking off for themselves; several messages can be sent all or none (batches).

  • A SendGrid-compatible API at /sendgrid/v3, so that SendGrid's clients and adapters work by changing the host and the key: mail send (JSON, up to 30 MB, also gzip-compressed; one message per personalization, all or none, with substitutions, custom arguments, categories, headers, attachments and inline images, scheduled sending and per-message tracking switches); the bounces, spam reports and global unsubscribes on the server's suppression list (paged by limit and offset, by time and by address). Options Karta cannot honour (stored templates, sections, batch ids, unsubscribe groups, mail settings, subscription and Google Analytics tracking) are refused, not ignored. Checked with SendGrid's official Ruby client in a container, with Swoosh's Sendgrid adapter, and against the examples of SendGrid's OpenAPI description.

  • The suppression list can be paged by offset, filtered by the time of change and by an address pattern, and several addresses of a reason can be removed at once.

  • A documentation site built with ExDoc (mix docs, output in doc/): guides for users, operators and contributors in guides/, the module reference, and the OpenAPI document of /api/v2, exported when the site is built. Links are relative, so the site works under any path; CI builds it with warnings as errors.

  • Signing in to the admin interface: through an OpenID Connect provider (tested with Authentik; authorization code flow with PKCE, state and nonce; only addresses the provider has verified; users created on first sign-in; administrators and organisation roles from the provider's groups), or with local login (off by default: a password and a TOTP code, limits per address and per client, the same answer whether or not an account exists). Sessions are stored on the server, last 12 hours, end when the user signs out or is disabled, and get a new cookie at sign-in. The first page lists the user's organisations with their role.

  • Roles per organisation (owner, admin, member, read-only) and what each may do (Karta.Accounts.Scope); instance administrators.

  • Release commands: Karta.Release.local_user/2 (a local account with a new password), Karta.Release.make_admin/1, Karta.Release.link_oidc/2 (links a Karta user to the identity provider's account; Karta never does so by e-mail address unless KARTA_OIDC_LINK_BY_EMAIL=true) and Karta.Release.reencrypt_secrets/0.

  • Vault key rotation from the environment (KARTA_VAULT_RETIRED_KEYS) and re-encryption of the stored secrets under the active key.

  • KARTA_TRUSTED_PROXIES: the reverse proxies whose X-Forwarded-For and X-Forwarded-Proto Karta believes, on both HTTP endpoints.

  • Admin pages for organisations (create, rename), their members (add, change roles, remove; read-only where the identity provider manages them), mail servers (settings, suspension), domains (verification, DKIM keys and the records to publish) and credentials (API keys and SMTP logins, their secrets shown once; revoking), and an account page (sessions, signing out elsewhere; for local accounts a new password and a new authenticator app). Every page and every action on it checks the user's role as it is in the database at that moment; a page the user may not see answers 404.

  • Karta.Servers.suspend/2 and resume/1: a suspended server's credentials are refused, and the mail it had accepted waits, undelivered, until it is resumed. Suspending is an instance administrator's action and records a reason the organisation sees.

  • Admin pages for messages: a server's messages, newest first, with a search (addresses, subject and Message-ID; recipient state; tag; dates) and pages that follow a cursor in the page's own address; a message's envelope, recipients, delivery attempts, opens and clicks, plain text, attachments and header, and the message as stored, as a download. Its HTML part is shown in a sandboxed frame whose document comes from a route of its own: made safe first (Karta.Mail.SafeHTML keeps nothing that runs, loads or submits anything, and shows the message's own cid: images as data: URIs) and served under a policy that forbids scripts and every remote resource. Messages larger than 10 MiB are only offered as a download. Everyone in the organisation may read them.

  • The organisations on the home page come in pages of 50 (Karta.Pager, keyset pages, which the messages page uses too).

  • MTA-STS for outbound delivery (RFC 8461): the recipient domain's _mta-sts record is looked up before each delivery and a new policy version is fetched over verified HTTPS (only a 200 with text/plain, no redirects, 60 s and 64 KiB at most, a version tried at most every five minutes); policies are kept in Postgres for their max_age and applied even when DNS or the policy host fails, and fetched again daily. In enforce mode mail goes only to MX hosts the policy names, over TLS with a valid certificate, and is deferred otherwise, never sent in clear; testing mode checks and reports but delivers.

  • TLS report data (RFC 8460): every TLS session of a delivery is recorded with its result (success or the failure type), the policy it ran under, the MX host and both addresses, and failed policy fetches too; kept for 30 days (Karta.TLSReport).

  • Karta.NetGuard: host names that others choose (an MTA-STS policy host) are resolved by Karta, private and special addresses are refused, and the connection goes to the address that was checked.

  • DANE for outbound delivery (RFC 7672, RFC 7671): the TLSA records of an MX host are looked up when its MX and address records were validated with DNSSEC, and decide for that host before MTA-STS and the configuration. With usable records (DANE-EE, DANE-TA) the server must present a matching certificate, and nothing else is trusted; with unusable records TLS is still required; a failed lookup skips the host. Nothing is sent in clear. :dane in :tls_policies requires DANE for a domain. TLS report data gets the policy type tlsa and the results tlsa-invalid, dnssec-invalid and dane-required.

  • REQUIRETLS (RFC 8689): offered after STARTTLS on the submission listeners (KARTA_SMTP_REQUIRETLS) and kept with the message; such a message goes only to an authenticated MX host (DNSSEC, or named by the domain's MTA-STS policy), over verified TLS, to a server that offers REQUIRETLS, with REQUIRETLS on MAIL FROM, and bounces with 5.7.30 otherwise; its delivery status notification carries the header only. A message with TLS-Required: No has the recipient's DANE and MTA-STS policies reported but not enforced.

  • The development resolver's test zones have an MX host on 127.0.0.1 with a TLSA record that matches no certificate (dane.karta.test and dane.karta-insecure.test); the signed zone's serial is 3.

  • IP pools (Karta.IPPools): groups of sending addresses, IPv4 and IPv6, each with its HELO name, checked when it is added against the address's PTR record and the name's A or AAAA record; servers are assigned to a pool. A server's mail goes from its pool's addresses (each connection bound to one, one per family and message) with that address's name in EHLO, only to the recipient servers' addresses of the pool's families; behind one-to-one NAT a local address is bound in the public one's place. Each pool's delivery jobs run in a queue of their own, outbound_<name>, which runs only on the nodes that hold one of the pool's addresses: an address that moves between nodes (a keepalived virtual address, a cloud's floating address) takes the delivery with it, and mail waits while no node holds one. The metric karta_ip_pool_address_held shows which node holds each address. Karta.IPPools.check_spf/3 checks a pool's addresses against a sending domain's SPF record.

  • The SMTP client can bind a connection to a chosen local address.

  • The admin interface's design system and shell: colour tokens for light and dark schemes, Karta's own components (no component library), a sidebar with the navigation of the page's organisation and mail server, breadcrumbs, the logo (a flamingo carrying a bag of letters, with the name in Nunito, shipped under the SIL Open Font License) and a favicon. Every page is laid out with them; states are badges with words and icons; tokens, keys and DNS records have copy buttons. The guides describe the interface's structure, its design system and how its pages will update by themselves.

  • A mail server's overview page: its state and token, the last 24 hours (messages accepted, their recipients by state, messages per hour as a chart drawn on the server) and how it sends; its settings and suspension moved to …/settings. A suspended server says so on every one of its pages.

  • Warm-up plans for IP pool addresses (Karta.IPPools.create_warmup_plan/1, start_warmup/3): a limit of recipients for each day from the day an address's warm-up starts (UTC days), held across nodes and jobs by a counter per address and day in the database. An address at its limit is passed over for another of the pool with room; recipients for whom there is none wait without an attempt, and the retry period keeps running.

  • Limits per destination (KARTA_OUTBOUND_DESTINATION_LIMITS, or an IP pool's own): connections at once and recipients per minute, by group of MX hosts (*.example.com), counted on each node per pool. A delivery over a limit waits without an attempt.

  • An IP pool's own delivery concurrency (Karta.IPPools.update_pool/2).

  • Metrics: karta_warmup_sent and karta_warmup_limit for each address in its warm-up, and karta_delivery_held_back_recipients by reason and pool.

  • Admin pages that update by themselves while they are open: the messages list (new messages that match the search at the top of the first page, rows changing in place, the search, the page and the scroll kept), a message (recipients, delivery attempts, opens and clicks; a notice when it is removed), a server's overview, an organisation's overview and its domains. Changes are announced after their transaction commits, with ids only (Karta.Changes); each page reads them again through its own query for the signed-in user, at most once a second, and checks the user's access again each time. A "Live" sign shows while a page is connected; changed rows are highlighted for a moment, unless the browser asks for reduced motion. A member whose role changes, or who is removed, has their open pages reloaded under the new role.

  • Tracking hosts of sending domains (Karta.Tracking.Hosts): a verified domain gets a name of its own for tracking, such as click.example.com, a CNAME record to Karta's tracking host (KARTA_TRACKING_CNAME, by default the host of KARTA_TRACKING_URL), checked when it is added and every hour. The links, the open pixel and the List-Unsubscribe URL in mail from that domain use it; a server can name one of its organisation's hosts for mail from domains without their own; otherwise the tracking URL is used as before.

  • Certificates for many tracking hosts: GET /tls/ask?domain=<name> on the tracking endpoint answers a reverse proxy's on-demand TLS question (Caddy's on_demand_tls) and approves only the tracking URL's host and verified tracking hosts; alternatively Karta writes a Traefik dynamic configuration file for each of them (KARTA_TRACKING_TRAEFIK_*).

  • The tracking host on a domain's page (the CNAME record to publish, the last check, checking again, removing it) and a server's tracking host in its settings.

  • Domain ownership by DNS: an organisation verifies a domain by publishing _karta.<domain> TXT "karta-verification=<token>", checked when someone asks and every hour (Karta.Domains.check_ownership/2, Karta.Domains.Check); a domain verified that way loses verification once its record has been gone for 7 days, and a failed lookup changes nothing. An administrator can still verify a domain without the record.

  • DNS health checks of sending domains (Karta.Domains.Health), every hour and on request: SPF (every sending address, IPv6 too, at most 10 lookups, the qualifier of all), DKIM (every key's record), DMARC (the policy or the organisational domain's, rua, pct, and whether Karta's mail is aligned for quarantine or reject), MX, reverse DNS and HELO, the return path domain, MTA-STS (the record and the policy, every MX host covered), TLS-RPT and BIMI; each finding with what to do and, where Karta can write it, the record to publish.

  • The Public Suffix List, vendored (Karta.PublicSuffix), for DMARC's organisational domain.

  • A domain's page shows its ownership record and its DNS health, and updates by itself as checks finish.

  • DKIM rotation with dual publication: Rotate on an active key (Karta.Domains.rotate_dkim_key/1) generates a pending key of the same kind; the hourly check (Karta.Domains.Rotation.advance/2) activates it once its record has been in DNS for an hour and retires the key it replaced a week later. The domain's page shows each step and its keys update by themselves; Activate looks the key's record up first.

  • Publishing through PowerDNS (Karta.PowerDNS, Karta.PowerDNS.Sync, KARTA_POWERDNS_URL, _API_KEY, _SERVER_ID, _ZONES): Karta's own records of verified domains (the ownership record, the DKIM keys' records, the tracking host's CNAME record) in the zones the operator lists, every hour and from the domain's page after a dry-run diff; only RRsets Karta wrote are replaced or removed, others are left alone and reported; a run with nothing to change sends nothing. dev/powerdns.sh starts a throwaway PowerDNS server for the tests tagged :powerdns.

  • MTA-STS policies served by Karta (Karta.MTASTS.Hosting): a verified domain's policy (mode, MX names, max_age) at https://mta-sts.<domain>/.well-known/mta-sts.txt on the tracking endpoint, once the CNAME record of mta-sts.<domain> points to Karta (checked every hour); certificates for those names through the ask endpoint or the Traefik files; the _mta-sts record's id follows the policy's text. enforce is saved only when every MX host of the domain is in the policy and accepts STARTTLS with a valid certificate (Karta.MTASTS.Probe); a policy is removed only once withdrawn.

  • The address of a domain's TLS reports (Karta.Domains.TLSReporting) and its _smtp._tls record.

  • BIMI logos (Karta.BIMI): uploaded on the domain's page, checked against SVG Tiny PS (Karta.BIMI.SVG, OTP's SAX parser with entities refused), served at /bimi/<sha256>.svg on the tracking endpoint, with the default._bimi record and the mark certificate's URL.

  • The domain's page sets the MTA-STS policy, the TLS reports' address and the BIMI logo, with their records, live; <.file_input> for uploads. Where Karta publishes the zone, their records are published too.

  • The Public Suffix List is fetched every night from KARTA_PUBLIC_SUFFIX_URL (publicsuffix.org's by default; off keeps the vendored list), checked, and kept in the database for every node (Karta.PublicSuffix.Refresh, Karta.PublicSuffix.Loader).

  • Webhooks (Karta.Webhooks): a server's events (message.accepted, .suppressed, .delivered, .deferred, .bounced, .opened, .clicked, .unsubscribed) recorded in the transaction that records what happened, for the webhooks that want them, and sent as JSON (version 1) signed as Standard Webhooks (webhook-id, webhook-timestamp, webhook-signature with v1, HMAC-SHA256; Karta.Webhooks.Signature, checked against the reference library's cases); whsec_ secrets shown once, encrypted by the vault and re-encrypted with it, rotated with a day's overlap (two signatures); 12 attempts over about three days, then a dead letter; at most four requests at once per webhook; a webhook failing for five days is switched off; deliveries replayed one by one or by time range; a test event; events kept 30 days (Karta.Webhooks.Pruner). The Oban queue webhooks (KARTA_WEBHOOKS_CONCURRENCY); https URLs only unless KARTA_WEBHOOKS_ALLOW_HTTP=true.

  • /api/v2/webhooks: add, list, change, remove, rotate the secret, a test event, deliveries with every request made, replays; the scopes webhooks:read and webhooks:write.

  • Karta.NetGuard.HTTP: one HTTP request to a URL someone else gave, through the NetGuard: the host resolved once, refused addresses never connected to, the checked address connected to with the URL's host in Host and SNI, no redirects, a time limit and a body limit.

  • KARTA_NET_GUARD_ALLOWED_NETWORKS: networks the operator allows although the NetGuard refuses them, for every connection it guards.

  • Webhook formats (Karta.Webhooks.Format), chosen when a webhook is added: standard (Standard Webhooks), postal and mailgun. Postal's format (Karta.Webhooks.Postal): Postal's envelope, events and payloads, signed with X-Postal-Signature (RSA-SHA1), X-Postal-Signature-256 and X-Postal-Signature-KID under the key of the webhook's organisation (Karta.Webhooks.PostalKey), encrypted by the vault and published at that organisation's JWK set and as Postal's DNS record; signatures, key ids and JWK sets checked against Postal's own code. Mailgun's format (Karta.Webhooks.Mailgun): signature and event-data, the HMAC-SHA256 of timestamp and token under a signing key per webhook, checked against Action Mailbox's verification.

  • The domain.dns_failed webhook event: a DNS health check of a verified domain turned to a problem, once per problem, for every server of the organisation (DomainDNSError in Postal's format).

  • Webhook URLs may carry a user name and password (https:// only): stored apart and encrypted, sent as Basic authentication, never shown (the API shows basic_auth_user) or logged (url parameters are filtered from logs and error reports).

  • Webhook events' data also have the message's size and created_at, a click's link_id, and why a suppressed recipient is suppressed.

  • /api/v2/webhooks: format, basic_auth_user, 409 no_secret; a delivery's payload is its body in the webhook's format.

  • Karta.Postal: what the Postal-compatible API and Postal's webhook format say alike (a message's token).

  • Webhooks in SendGrid's format (Karta.Webhooks.Sendgrid): SendGrid's Event Webhook events, one per request in an array, signed as SendGrid's Signed Event Webhook (ECDSA P-256 over timestamp and body) with a key pair per webhook, whose private key is never shown and whose public key (public_key over the API) SendGrid's libraries verify with; checked against sendgrid-ruby's own vectors and verification.

  • Webhooks in Postmark's format (Karta.Webhooks.Postmark): Postmark's Delivery, Bounce (hard, soft and transient), Open, Click and SubscriptionChange records with X-PM-Webhook-Trace-Id; not signed, as Postmark's (a user name and password in the URL authenticate Karta).

  • Mailgun's webhooks API (/mailgun/v3/domains/{domain}/webhooks, KartaWeb.Mailgun.WebhookController, Karta.Webhooks.MailgunSettings) and SendGrid's Event Webhook settings (/sendgrid/v3/user/webhooks/event/..., KartaWeb.Sendgrid.WebhookController): the server's webhooks in those formats, managed with the providers' official clients; the webhooks Mailgun's API makes share one signing key, rotated together.

  • The webhooks pages of the admin interface (KartaWeb.WebhookLive.Index, .Show and .Delivery): a server's webhooks with their formats, events and states; a webhook's URL (the user name of its Basic authentication, never the password), signing by format (SendGrid's public key to copy, where Postal's instance key is published, Postmark's lack of a signature, the webhooks that share a Mailgun key), its deliveries by state and a delivery's body and requests, all live. Owners and admins (:manage_webhooks, a new action of Karta.Accounts.Scope) add webhooks in a format chosen once, change them, switch them off and on, send test events, rotate secrets (shown once; a shared Mailgun key for every webhook that shares it), remove them, and send a delivery, or the failed deliveries of a period, again.

  • Karta.Webhooks.page_deliveries/2 (a webhook's deliveries in pages of Karta.Pager) and Karta.Webhooks.sharing_key/1 (the webhooks that sign with the same Mailgun key).

  • Webhook events' data also say whether an open is the recipient's first (tracking.first).

  • The provider-clients development image is karta-dev-provider-clients:5 (a script for the webhook APIs).

  • The NetGuard also refuses IPv4-translated addresses (::ffff:0:0:0/96), IPv6 benchmarking (2001:2::/48) and the second IPv6 documentation range (3fff::/20).

  • Automatic replies can be sent with the null reverse path (MAIL FROM:<>, RFC 3834 §3.3, RFC 5321 §4.5.5): auto_reply: true on POST /api/v2/messages/raw and POST /kantoor/v1/messages/raw, with mail_from empty or left out, requires Auto-Submitted: auto-replied or auto-generated in the message. Such a message is delivered without a VERP return path, is never the subject of a DSN (RFC 5321 §6.1), and its synchronous failures are still recorded, retried or bounced as usual; suppressions, rate limits and the metrics apply unchanged. Receivers judge its SPF on the HELO name (RFC 7208 §2.4).

  • KARTA_OUTBOUND_PORT (tests only; unset, deliveries go to port 25 and the setting does not exist for the code): the port every delivery connects to, so that a production release can deliver to a test destination, together with KARTA_NET_GUARD_ALLOWED_NETWORKS for the destination's address. It stops the release at start when it is not a port, and Karta logs a warning when it is set.

  • The provisioning API (/api/v2/provisioning, guide Provisioning API): for an external system that signs customers up, instance-wide keys (bin/karta eval 'Karta.Release.provisioning_key("name")', scopes provisioning and provisioning:read; they read no mail and work on no other API) and, first, organisations by the system's own reference: PUT makes or returns one with its mail server, suspend, resume and DELETE, all idempotent. Its own OpenAPI document is at /api/v2/provisioning/openapi.json. Organisations have an external reference, a suspension and a deletion; a deleted organisation shows nowhere.

  • The provisioning API adds domains: PUT adds a sending domain with its first DKIM key and returns the DNS records to publish as data (ownership, DKIM selector and key, SPF from Karta's sending addresses, a DMARC start, MX, the return path domain); verify looks at DNS now, activates the first key and runs the health checks.

  • The provisioning API adds credentials (API keys with scopes, SMTP logins, named by the calling system's reference; the secret is shown when they are made or rotated; rotate, delete) and webhooks (registered or updated by reference; the signing secret shown once; secret rotates it).

  • Sending limits and a trust level for organisations (Karta.Quotas): a daily limit on recipients, a limit on messages to one recipient address a day, and restricted (at most 5 recipients to a message, no batches) or standard. They are counted when a message is accepted, in the same transaction, for SMTP submission and every HTTP API, and a refused message counts for nothing (429 sending_limit_reached with Retry-After, 403 organisation_restricted; SMTP 450 4.7.1 and 550 5.5.3). The provisioning API sets them (/limits); an organisation it makes starts restricted with 100 recipients and 10 messages per recipient a day.

Changed

  • The upgrades guide has the backup and restore commands step by step, and the receiving guide says that sent mail is not scanned, on purpose, for 1.0.

  • The domain page says why a DKIM key can stay pending for up to an hour after its record was published (the resolver's negative cache), and the domains guide says to publish the records before adding the domain.

  • A raw send with an empty envelope sender (mail_from: "") now requires Auto-Submitted: auto-replied or auto-generated; it was accepted without either. Ordinary messages can therefore no longer use the null sender to hide from bounce handling.

  • Rate limits that guard an account or a credential are counted in the database (Karta.Limits, one row per key and window): each API key's requests, each SMTP credential's messages, login attempts per address and per client, TOTP codes and API key verifications hold across every node, where they were counted per node and two nodes allowed twice the limit. A counter that cannot be read refuses the event, and a login address's attempts are counted under a hash of the address. The in-memory counters that remain (Karta.RateLimiter: tracking events, MTA-STS fetches) are bounded and remove the windows closest to their end first, and a reading while their owner restarts is a miss or a refusal, never a crash (Karta.ETS.lookup/2). A credential's last use is written in one statement a minute and at shutdown, not on every request (Karta.Credentials.Used).

  • Delivery jobs (Karta.Outbound.Deliverer) and webhook delivery jobs (Karta.Webhooks.Sender) claim what they send with one conditional update (Karta.Claim): a second job for the same message and domain, or for the same webhook delivery, sends nothing, and a node killed in the middle of a delivery leaves the recipient or delivery to be tried again after the claim instead of losing it. Oban's rescue_after bounds the wait; at most the transaction that was in flight is sent twice.

  • A recipient's complaint and the server's suppression policy: Mailgun's webhooks API no longer refuses complained (400), SendGrid's spam_report switch is on for a webhook that receives every event, and Mailgun's and SendGrid's suppression lists no longer list entries whose expiry has passed.

  • The route pages edit a route's spam settings: the score from which a message counts as spam, what happens to it (marked, held or refused), and whether a message whose scanner cannot answer is refused.

  • The domain page is composed of cards, each a function component in KartaWeb.DomainLive.Components (verification, DNS health, keys, tracking host, MTA-STS, TLS reports, BIMI and publishing) that declares and handles its own events; KartaWeb.DomainLive.Show loads the domain and composes them. Behaviour and URLs do not change.

  • The webhook delivery list, the message list and an organisation's list share one pagination mechanism (Karta.Pager); the provider APIs' cursors keep their contract.

  • The provider-clients development image is karta-dev-provider-clients:5 (Postmark's official Ruby client, the postmark gem).

  • Postmark's bounce types live in Karta.Postmark, shared by the Postmark-compatible API and webhooks in Postmark's format (whose requests do not change).

  • Batch requests are limited by KARTA_BATCH_MAX_MESSAGES (100 by default, at most 1000; Karta.Sending.Options.batch_limit/0): Mailgun's recipient-variables, SendGrid's personalizations and the Karta API's batches had up to 1000 messages. Mailgun's and SendGrid's batches, like the Karta API's, may have at most 50 MiB of content in all their messages together, counted as they are made (Karta.Sending.Options.make_batch/2), so that a request's memory is bounded. The checks of tags, variables, the time to send and tracking moved from Karta.Sending to Karta.Sending.Options.check/2. The Karta API answers too_many_recipients over the limit.

  • Publishing moved from Karta.PowerDNS.Sync to Karta.DNS.Publish, and the domain columns powerdns_synced_at, powerdns_failure and powerdns_failed_at are now dns_synced_at, dns_failure and dns_failed_at (a migration renames them). The configuration and API key of PowerDNS are read into Karta.PowerDNS.Config, whose inspect redacts the key; the RFC 2136 secret is redacted the same way.

  • Postal-format signing is per organisation. The instance's single key and /.well-known/jwks.json are gone; the migration removes its rows, and every organisation makes its own key when it first needs one. A receiver that fetched /.well-known/jwks.json must take the organisation's JWK set address instead (the webhook's page and GET /api/v2/postal-key show it). The release commands postal_signing_key and rotate_postal_signing_key take the organisation's slug or id (they took none before). The vault's re-encryption covers the new header values.

  • Karta.IPPools.SPF (the SPF check of IP pools and of sending domains' health) uses the new SPF evaluator; a name in a record may now hold any printable character RFC 7208 allows (Karta.DNS.lookup/3 takes names: :any). Karta.Storage.put_file/4 takes offset:.

  • The mx listener's default policy is Karta.SMTP.Policy.Inbound (it was Karta.SMTP.Policy.Closed, which refused every message), and its cache holds the routes. Karta.Messages.Intake.accept/3 takes :accept, how an incoming message is accepted. Delivery keeps the SRS sender of a forward when VERP is on, and nothing of tracking applies to a forward. The vault's re-encryption covers endpoints' secrets and credentials.

  • <.state> shows a webhook's state (on, failing, off, stopped) and a delivery's (pending, retrying, succeeded, failed); <.secret> says how Karta keeps a secret (kept: a hash, or encrypted for one it signs with); a page's breadcrumbs can name the records on the way to it.

  • A webhook added without a format is refused (format "can't be blank") rather than failing.

  • The DNS health checks of MTA-STS, TLS-RPT and BIMI compare what is published with what is set in Karta, and give Karta's records to publish; the Traefik files and the ask endpoint cover MTA-STS policy hosts; a Traefik file's comment names its host.

  • Activate on a domain's page activates a DKIM key only once its record is in DNS (Karta.Domains.Rotation.activate/2); Karta.Domains.activate_dkim_key/2 takes the time of activation and records when the replaced key started retiring.

  • Karta.IPPools.SPF.evaluate/3 gives the number of DNS lookups an SPF evaluation took with its result.

  • Renaming an organisation keeps its slug, which the identity provider's group mapping names (Karta.Accounts.rename_organisation/2).

  • A server's mode is no longer taken from input; it stays live until holding mail in development mode exists.

  • A name whose slug is taken is reported on name, the field people fill in, for organisations and servers.

  • lazy_html (an HTML5 parser) is a dependency of the application, no longer of the tests only: message HTML is parsed as a browser parses it before it is made safe.

  • Delivery under verified TLS names the certificate problem (not valid for the MX host, expired, not from a trusted root) in the attempt's details.

  • mint (already locked as Req's HTTP client) is a direct dependency: the MTA-STS policy fetch uses it to connect to a checked address while it verifies the certificate for the policy host's name.

  • daisyUI is no longer a dependency, and the default favicon is replaced by Karta's mark.

  • A delivery run looks up the recipient's mail servers before it reads the stored message, so that the limits are decided first; the outcomes are the same.

  • The v2 API's tag is one of the message's tags and is checked as they are (1 to 128 bytes without control characters): an empty tag is refused (invalid_tags).

  • An open or a click is recorded in a transaction with its webhook event, and a one-click unsubscribe with its; Karta.Outbound.MXResolver's default refused ranges are the NetGuard's (default_blocked_networks/0 delegates to it), and it takes :allowed_networks.

Fixed

  • The page of a received message (the one the Received list opens) had no "Scan" panel and no way to release held mail: both were only on the message page, which nothing links to for received mail. Both are on the received message page now, and one component (KartaWeb.ScanPanel) draws the panel.

  • Behind Traefik the admin pages never got their live (WebSocket) connection: Traefik says X-Forwarded-Proto: wss for an upgrade, Karta ignored the value, saw plain HTTP and answered the upgrade with the redirect to HTTPS (301), so every page fell back to long polling. wss and ws now count as https and http.

  • A delivery's last answer read "250 2.0.0 250 2.0.0 OK queued as ...": the codes were put in front of text that already had them.

  • A mail server's page without messages read "No messages in the last {@usage_days} days": the number was not filled in.

  • The guides said the X-Spam-Symbols field holds at most 20 symbols (it is cut at 900 bytes), and that KARTA_RSPAMD_PASSWORD is the controller's password (Karta only calls the scanning worker).

  • The installation guide, the README and the development guide said things that are no longer true (Karta cannot receive mail; the admin pages are being built; rspamd and ClamAV are not used; the mx listener refuses every recipient) and left out steps an operator needs: the migration in the README's container section, KARTA_DNS_SERVER (the default is the container itself), a way to sign in (KARTA_LOCAL_LOGIN or an OpenID Connect provider), making the first administrator, and a certificate for STARTTLS on the mx listener.

  • The reports summary tables are no longer cut off at 1280 pixels, the DMARC chart shows its first and last day, and a failure report without a reporter name no longer shows an empty "Reporter" field.

  • Two runs of a job at the same moment could take the same rows (the delivery queue's sweep, the webhook and inbound senders, the report runs): the claim is now made with locked rows, so a second run skips them. Found with two nodes on one database.

  • The RFC 2136 provider sends every update over TCP, so a lost answer to an update cannot be taken for a lost request, and reads each name with a TXT and a CNAME query rather than an ANY query. It follows a compressed TSIG owner name (RFC 1035 §4.1.4, legal for an owner name), and its error texts now say what YXRRSET, NXRRSET, NOTAUTH and REFUSED mean, reporting a BADTIME answer as a clock difference with the server's time. A new CNAME requires that nothing is at its name, since the typed reads do not see other types; a server answers YXDOMAIN rather than silently ignoring a CNAME beside an A or MX record.

  • An SMTP session counts its 452 answers for recipients past the recipient limit toward its rejections, as it counts policy rejections, so a client cannot keep naming recipients for the session's whole hour.

  • Sending a message with an empty Reply-To list no longer fails; it has no Reply-To.

  • A message's deliveries are listed in the order they were made (two made in the same millisecond could come back in either order).

  • The Postal-compatible API's delivery output is the server's reply as it wrote it; the reply code and enhanced code were repeated in front of it.

  • An SMTP listener holds at most max_connections connections; the limit was applied to each of its acceptors, so it held up to ten times as many.

  • A delivery attempt that bounced before MAIL (the receiving server lacks SMTPUTF8 or 8BITMIME, or the message is larger than its SIZE) after STARTTLS records the TLS version and cipher; they were left out.

  • The Compose and Kubernetes examples could not run Karta: neither set KARTA_SMTP_ENABLED=true (no SMTP listener started), neither had a DNS resolver (KARTA_DNS_SERVER defaults to a loopback address inside the container), the Compose file used MinIO images that are no longer on Docker Hub (now a one-node Garage with garage-bootstrap.sh), its health check used wget, which the image does not contain, the migration container got RELEASE_DISTRIBUTION=name without a node name, and HAProxy sent no X-Forwarded-For. The examples were validated as far as possible without a cluster (see their READMEs).

Security

  • A mailbox endpoint registered through /kantoor/v1 belongs to the key that registered it. Before, any Kantoor key of the same server could re-register an endpoint of the same name and change its URL, or point a route at another key's endpoint, diverting the mail that key's routes send there. Now only the owner, or an unrestricted key of the same server (which adopts the endpoint), may register it again, change it or route to it; a restricted key may not touch an endpoint it does not own, nor one whose owner is gone (403 forbidden_endpoint, revealing nothing of the other endpoint). A partial unique index on a mailbox endpoint's name settles simultaneous registrations, and simultaneous route creations answer as a sequential second request would (200 when identical, otherwise 409 route_conflict, not 422).

  • X-Forwarded-Proto is believed only from the configured trusted proxies; before, the redirect to HTTPS believed it from any client. Behind trusted proxies, the client address in X-Forwarded-For is used for the limits per client, the network recorded for opens and clicks and the Received field of mail sent through the APIs; it is never taken from anyone else.

  • The APIs read a request's body only after its key has been accepted, so a client without a key cannot make Karta read or decompress large bodies.

  • The limit on API key verifications counts an IPv6 client by its /64, so that it cannot be avoided by changing addresses within one network.

  • The tracking host also redirects to HTTPS and sends HSTS in production.

  • The admin pages send a strict content security policy (no inline scripts or styles, nothing from other hosts, no framing), no-referrer, a permissions policy and no-store; the session cookie is encrypted, HttpOnly, SameSite=Lax and, in production, Secure under the __Host- prefix.

  • An organisation always keeps an owner once it has one, and only owners make or unmake owners; changes to one organisation's members take turns, so that two owners cannot demote each other at the same time.

  • Delivery never connects to a recipient's mail server at a private, carrier-grade NAT, unique local, NAT64, 6to4, Teredo, documentation or other special address (or such an address literal) unless the operator allows the network; before, only loopback, link-local, multicast and reserved addresses were refused, so a domain whose MX record named an address on Karta's own network made Karta connect to it.