Configuration reference
A production release is configured through environment variables, read at
start by config/runtime.exs. This page lists every variable it reads, then
the settings that exist only in the configuration files, and finally the
settings that are per mail server (in the database).
A required variable that is missing stops the release at start with an error that names it.
Core
| Variable | Default | Meaning |
|---|---|---|
DATABASE_URL | required | Postgres URL, ecto://USER:PASS@HOST/DATABASE. |
POOL_SIZE | 10 | Database connections per node. |
ECTO_IPV6 | off | true or 1 connects to Postgres over IPv6. |
KARTA_DATABASE_POOLER | unset | pgbouncer for pgbouncer in transaction mode: prepared statements become unnamed and Oban's notifier becomes Oban.Notifiers.PG (the nodes must be clustered). |
SECRET_KEY_BASE | required | Signs and encrypts cookies. At least 64 bytes; mix phx.gen.secret. |
KARTA_VAULT_KEY | required | The active vault key: base64 of exactly 32 bytes (openssl rand -base64 32). Encrypts secrets at rest and derives the keys of stored messages, tracking tokens, VERP tags and paging tokens. |
KARTA_VAULT_KEY_ID | v1 | The label stored with every value encrypted under the active key. Change it together with the key when you rotate. |
KARTA_VAULT_RETIRED_KEYS | unset | Old vault keys that still decrypt and verify: id:base64 pairs separated by commas. See key rotation. |
PHX_HOST | example.com | Public host name of the API and the admin pages, used in URLs Karta writes (scheme https, port 443) and in the identity provider's redirect URI. |
KARTA_TRUSTED_PROXIES | unset | Comma-separated CIDR ranges of the reverse proxies in front of the HTTP endpoints. X-Forwarded-For and X-Forwarded-Proto are believed only from them. See Installation. |
PORT | 4000 | Port of the main HTTP endpoint (APIs, /livez, /readyz, /health). |
PHX_SERVER | unset | When set, the HTTP endpoints serve requests. bin/server (the image's command) sets it. |
KARTA_CLUSTER | false | true lets replicas find each other through the database and form an Erlang cluster (faster live updates, a shared share of the per-destination throttle). Nothing needs it for correctness. See Running several replicas. |
KARTA_CLUSTER_DATABASE_URL | the main DATABASE_URL | The direct Postgres connection discovery listens on (LISTEN does not pass a transaction pooler). Required when KARTA_DATABASE_POOLER is set; without it clustering stays off. |
KARTA_NODE_HOST, KARTA_DIST_PORT | the pod's address (hostname -i), 9100 | The address the other replicas reach this one on, and the fixed Erlang distribution port. Open it, and 4369, between the replicas only. |
RELEASE_COOKIE | unset | The secret the replicas of a cluster share. Required with KARTA_CLUSTER: bin/server refuses to start a clustering replica without it. |
RELEASE_DISTRIBUTION, RELEASE_NODE | set by the release when KARTA_CLUSTER=true | Override only to name nodes yourself. |
KARTA_LOG_FORMAT | text | json writes each log line as one JSON object (time, level, message, request_id) for a log collector. |
Metrics and errors
| Variable | Default | Meaning |
|---|---|---|
METRICS_PORT | 9568 | Port of the Prometheus listener (GET /metrics only). Keep it internal. |
SENTRY_DSN | unset | A Sentry-protocol DSN (Sentry, Bugsink, GlitchTip, ...). Without it nothing is sent. Errors and error-level log messages are reported, with the environment name prod. |
Message storage
Without KARTA_S3_BUCKET no blob store is configured and no message can be
stored: SMTP clients get 451 4.3.0 and the APIs a temporary failure.
| Variable | Default | Meaning |
|---|---|---|
KARTA_S3_BUCKET | unset | The bucket for message bodies. Setting it requires the next three. |
KARTA_S3_ENDPOINT | required with a bucket | The S3 endpoint, e.g. https://s3.example.com. Path-style URLs (<endpoint>/<bucket>/<key>) are used. |
KARTA_S3_ACCESS_KEY_ID | required with a bucket | Access key. |
KARTA_S3_SECRET_ACCESS_KEY | required with a bucket | Secret key. |
KARTA_S3_REGION | us-east-1 | Region for request signing (Garage uses its configured s3_region). |
Outbound delivery
| Variable | Default | Meaning |
|---|---|---|
KARTA_OUTBOUND_HOSTNAME | KARTA_SMTP_HOSTNAME, else the system host name | Karta's name in EHLO, in Message-IDs it makes, in its Received: fields of API messages and in delivery status notifications. Use the PTR name of the sending address. |
KARTA_RETURN_PATH_DOMAIN | unset | Turns on VERP return paths in this domain: every delivery gets the envelope sender b<id><tag>@<domain>. Its MX must lead back to Karta, which reads the bounces that arrive there. See Delivery. |
KARTA_BOUNCE_MAX_AGE_DAYS | 30 | How long a VERP return path is believed: an older one is refused with 550 5.2.1, so a stale bounce changes nothing. Any value other than a whole number from 1 to 3650 stops the release at start. |
KARTA_OUTBOUND_PORT | unset (port 25) | For tests only. The port every delivery connects to instead of 25, so that a release can deliver to a test destination: set it with KARTA_NET_GUARD_ALLOWED_NETWORKS naming the destination's private or loopback address, which Karta otherwise never connects to. Real mail servers listen on 25: with this set nothing reaches them. Karta logs a warning at start when it is set. Not a port number from 1 to 65535 stops the release at start. |
KARTA_OUTBOUND_IP_FAMILY | prefer_ipv4 | prefer_ipv4, prefer_ipv6, ipv4_only or ipv6_only. Any other value stops the release at start. |
KARTA_OUTBOUND_CONCURRENCY | 10 | Delivery jobs run at once per node: in the Oban queue outbound, and in each IP pool's queue the node runs (unless the pool has its own concurrency). |
KARTA_OUTBOUND_DESTINATION_LIMITS | unset (no limits) | Connections at once and recipients per minute by MX host, e.g. *.mx.example.com connections=5 per_minute=300, * connections=20. See Delivery. Text it cannot read stops the release at start. |
Batches
| Variable | Default | Meaning |
|---|---|---|
KARTA_BATCH_MAX_MESSAGES | 100 | The most messages one batch request may make, in every API: recipients of a Karta API batch or of Mailgun's recipient-variables, SendGrid's personalizations, the messages of Postmark's /email/batch. A whole number from 1 to 1000; any other value stops the release at start. A request over it is refused, in the API's own form, before any message is made. |
Memory. A batch request builds all its messages before it stores any (so that they are accepted all or none), and they are in memory together until then. One request therefore takes about N × the size of one built message, plus its body: a built message is its text, HTML and attachments, with about a third more for the base64 encoding of attachments and the MIME structure. Measured on one node, a Mailgun batch of a 400 KiB attachment and 20 KB of text per message (about 570 KB built) took about 12 MB at N = 10, 35 MB at N = 50 and 69 MB at N = 100: about 0.7 MB, or 1.6 times the content, per message. Independently of N, the messages of one request may have at most 50 MiB of content together (counted as they are made: the subject, text, HTML, attachments and inline parts of every message), so one batch request stays below about 100 MB. To size the limit, multiply what one request may take by the requests a node may serve at once: with the default of 100, a request of 100 messages of 100 KB each takes about 16 MB; with 1000 messages of the same size it would reach the 50 MiB cap at about 520 messages and be refused.
Outbound connections and webhooks
| Variable | Default | Meaning |
|---|---|---|
KARTA_NET_GUARD_ALLOWED_NETWORKS | unset (none) | CIDR ranges, comma-separated (e.g. 10.1.0.0/16,fd00:1::/48), that Karta may connect to although Karta.NetGuard refuses them: delivery to recipients' mail servers, webhook requests, MTA-STS fetches and checks. For receivers or mail servers on the instance's own network; nothing else should need it. An invalid range stops the release at start. |
KARTA_WEBHOOKS_ALLOW_HTTP | false | true lets webhooks use http:// URLs; otherwise only https://. |
KARTA_WEBHOOKS_CONCURRENCY | 10 | Webhook requests sent at once per node (the Oban queue webhooks). At most four go to one webhook at a time, across all nodes. |
Webhooks need outbound HTTPS (or HTTP) to the URLs their owners set.
Receiving mail
| Variable | Default | Meaning |
|---|---|---|
KARTA_REPORTS_FROM | unset | The address DMARC and TLS reports are sent from. It must be at a verified domain of the organisation of KARTA_REPORTS_SERVER; the reports are signed with that domain's DKIM keys. With this and KARTA_REPORTS_SERVER unset, no report is sent. See Reports. |
KARTA_REPORTS_SERVER | unset | The id of the mail server that sends the reports (its page shows the id). |
KARTA_REPORTS_DMARC | true | false stops sending DMARC aggregate reports. |
KARTA_REPORTS_TLS_RPT | true | false stops sending TLS reports. |
KARTA_REPORTS_DMARC_EXCLUDE | none | Domains, separated by commas, that no DMARC report is sent about; their subdomains are excluded too. |
KARTA_REPORTS_MAX_PER_DESTINATION | 100 | The most reports one address receives in 24 hours; more are not sent. |
KARTA_SRS_DOMAIN | KARTA_RETURN_PATH_DOMAIN | The domain of the SRS addresses that forwarded mail is sent from. Its MX records must lead to Karta and its SPF record must name Karta's sending addresses. Without either, forwards fail. See Receiving mail. |
KARTA_INBOUND_ALLOW_HTTP | false | true lets HTTP endpoints use http:// URLs; otherwise only https://. |
KARTA_ARC_TRUSTED_SEALERS | none | Domains, separated by commas, whose ARC seals Karta trusts: mail failing DMARC is not refused when its ARC chain passes, the newest set is sealed by one of them and its results say DMARC passed for the author's domain. Name only forwarders and lists you trust. See Checking the sender. |
KARTA_AUTHSERV_ID | KARTA_SMTP_HOSTNAME | The authserv-id of the Authentication-Results: field on received mail: the name applications trust those fields by. Use the same one on every node; arriving fields that claim it are removed. See Checking the sender. |
KARTA_INBOUND_CONCURRENCY | 10 | Deliveries of received mail to endpoints at once per node (the Oban queue inbound). A delivery to an HTTP endpoint holds the message and its encoding (base64 in JSON or form data) in memory, about 3 to 4 times the message, which may be 25 MiB: size a node for about 1 GB at peak with the default of 10, or lower it. |
KARTA_RSPAMD_URL | none | The HTTP API of rspamd, for example http://127.0.0.1:11333: it turns spam scanning of received mail on. Only this address is contacted (it is the operator's, not user input). See Spam and virus scanning. |
KARTA_RSPAMD_PASSWORD | none | Sent as the Password header of the scan request; printable ASCII. Karta only calls the scanning worker (/checkv2, port 11333), which needs no password: leave it unset unless rspamd is configured to ask for one there. It is not the web interface's (controller's) password. |
KARTA_CLAMAV_HOST, KARTA_CLAMAV_PORT, KARTA_CLAMAV_SOCKET | none, 3310, none | clamd's address: a host name or address and a port, or a Unix socket (not both). Setting either turns virus scanning of received mail on. The message is streamed to it, never held in memory. |
KARTA_SCAN_TIMEOUT | 5000 | The budget of one message's scan, in milliseconds (500 to 30000). A scanner that has not answered when it ends is stopped and counts as failed. rspamd's blocklist and SPF lookups can take several seconds when a name does not answer: 10000 to 15000 is a safer value than the default for production. |
KARTA_SCAN_MAX_SIZE | 26214400 | A message larger than this many bytes is not scanned. The default is the largest message the listeners take, so no accepted message is skipped for its size. |
Recipient domains' MTA-STS policies are read and followed with no setting
(Delivery); outbound HTTPS to the
policy hosts (port 443) must be allowed. config :karta, Karta.Outbound, mta_sts: false in a configuration file turns it off. DANE needs no
setting either: it relies on the resolver's DNSSEC validation
(DNS resolver); without a trusted validating resolver
TLSA records are never used.
DNS
| Variable | Default | Meaning |
|---|---|---|
KARTA_DNS_SERVER | 127.0.0.1 | IP address of the validating resolver. Must be an IP address. |
KARTA_DNS_PORT | 53 | Its port. |
KARTA_DNS_TRUST_AD | unset | true believes the resolver's DNSSEC AD bit although it is not on a loopback address. Only for a private path to the resolver. See DNS resolver. |
Public Suffix List
| Variable | Default | Meaning |
|---|---|---|
KARTA_PUBLIC_SUFFIX_URL | https://publicsuffix.org/list/public_suffix_list.dat | Where Karta fetches the Public Suffix List every night (04:29 UTC), for the organisational domain of the DMARC health check of sending domains, and so that no public suffix counts as an organisational domain when received mail is checked. An https URL, or off to keep the list Karta was built with; anything else stops the release at start. |
The list is fetched with the tag of the copy Karta has (an unchanged list
is not downloaded again), never through a redirect, at most 4 MB, and
used only when it looks like the list (both sections, at least 5,000
rules, rules every copy has had for years). It is kept in the database;
every node loads it at start and every hour. A failure is logged and kept
with the list (public_suffix_lists); the copy before it stays in use.
Point the URL at a mirror of your own when Karta's nodes may not reach
the internet.
SMTP listeners
Nothing in this table applies unless KARTA_SMTP_ENABLED=true, except
the two minimum prefix lengths: credentials are checked against them
whether or not a listener runs.
| Variable | Default | Meaning |
|---|---|---|
KARTA_SMTP_ENABLED | unset | true starts the SMTP listeners. |
KARTA_SMTP_HOSTNAME | required when enabled | The name in the greeting, in EHLO replies and in Received: fields. Must match the certificate. |
KARTA_SPOOL_DIR | required when enabled | Directory for message data being received. Disk-backed, writable, private to Karta. |
KARTA_SMTP_CERTFILE | unset | PEM certificate (chain) for the listeners. Without it only the mx listener runs, without TLS. With it the mx listener offers STARTTLS, and the submission listeners run unless KARTA_SMTP_LISTENERS leaves them out. |
KARTA_SMTP_DSN | true | false stops the submission listeners offering DSN (SMTP listeners). |
KARTA_DKIM_ROTATE_AFTER_DAYS | unset | Rotates an active DKIM key that has signed this many days (30 to 3650), in the domains whose zone Karta publishes. Unset: Karta rotates no key by itself. See Rotating keys. |
KARTA_SMTP_LISTENERS | all three with a certificate, mx without | Which listeners run: a comma-separated list of mx, submission, submissions. mx alone with a certificate receives mail with STARTTLS and opens no submission port. |
KARTA_SMTP_KEYFILE | required with a certificate | PEM private key (RSA or EC) of the certificate. |
KARTA_SMTP_MX_PORT | 25 | Port of the mx listener. |
KARTA_SMTP_SUBMISSION_PORT | 587 | Port of the submission listener (STARTTLS); only with a certificate. |
KARTA_SMTP_SUBMISSIONS_PORT | 465 | Port of the implicit-TLS submission listener; only with a certificate. |
KARTA_SMTP_REQUIRETLS | true | false stops the submission listeners offering REQUIRETLS (RFC 8689). The mx listener never offers it. |
KARTA_SMTP_TRUSTED_PROXIES | unset | Comma-separated CIDR ranges. When set, every listener requires a PROXY protocol v2 header, and accepts connections only from these ranges. |
KARTA_SMTP_SUBMISSION_TRUSTED_PROXIES | the value of KARTA_SMTP_TRUSTED_PROXIES | The same for the submission listeners (587, 465) alone. Set it to an empty value when a balancer fronts the mx listener only and the applications of the same host connect to the submission port directly: those listeners then take plain connections from anywhere they are published to. |
KARTA_SMTP_IP_MIN_PREFIX_V4 | 16 | The narrowest prefix an IPv4 range credential may have; a wider range (/15 and up) is refused at creation. 0.0.0.0/0 is never accepted. |
KARTA_SMTP_IP_MIN_PREFIX_V6 | 48 | The same for IPv6; ::/0 is never accepted. |
KARTA_SMTP_MX_IP_RELAY | false | true lets the mx listener accept relayed mail from an IP range credential; without it port 25 takes no relayed mail. |
Certificate files are read again every 60 seconds; a changed, valid pair is used for new handshakes without a restart. See SMTP listeners.
Sign-in
| Variable | Default | Meaning |
|---|---|---|
KARTA_OIDC_ISSUER | unset | The OpenID Connect provider's issuer URL; turns sign-in through it on. |
KARTA_OIDC_CLIENT_ID, KARTA_OIDC_CLIENT_SECRET | required with the issuer | Karta's client at the provider. |
KARTA_OIDC_NAME | single sign-on | The name on the sign-in button. |
KARTA_OIDC_ADMIN_GROUPS | unset | Groups whose members are instance administrators, comma-separated. |
KARTA_OIDC_GROUP_ROLES | unset | group:organisation-slug:role entries, comma-separated. A malformed entry stops the release at start. |
KARTA_OIDC_GROUPS_CLAIM | groups | The claim with the user's groups. |
KARTA_OIDC_AUTO_CREATE | true | false lets only users Karta already knows sign in. |
KARTA_OIDC_LINK_BY_EMAIL | false | true links a Karta user who has never signed in through the provider to the provider's account with the same verified address. Off, an operator links them with Karta.Release.link_oidc/2. |
KARTA_OIDC_CACERTFILE | unset | A CA bundle for the provider's certificate. |
KARTA_LOCAL_LOGIN | off | true turns on local login (password and TOTP). |
See Sign-in and access.
Tracking host
| Variable | Default | Meaning |
|---|---|---|
KARTA_TRACKING_URL | unset | Public URL of the tracking host, https://host or https://host:port, without a path. Any other form stops the release at start. Without it nothing is tracked and no List-Unsubscribe is added. |
KARTA_TRACKING_PORT | 4001 | Port of the tracking endpoint, to which the reverse proxy sends the tracking host name. |
KARTA_TRACKING_CNAME | the host of KARTA_TRACKING_URL | The name that sending domains' tracking hosts and MTA-STS policy hosts point their CNAME records to (Tracking hosts of sending domains, Hosting an MTA-STS policy). A host name; anything else stops the release at start. |
KARTA_TRACKING_TRAEFIK_DIR | unset | A directory that Traefik's file provider watches: Karta writes a router there for each verified tracking host and each MTA-STS policy host in use (Certificates for tracking hosts). |
KARTA_TRACKING_TRAEFIK_SERVICE | required with the directory | The Traefik service that reaches the tracking endpoint, such as karta-tracking@docker. |
KARTA_TRACKING_TRAEFIK_CERT_RESOLVER | unset | The routers' certificate resolver, such as letsencrypt. Without it they use the certificates Traefik already has. |
KARTA_TRACKING_TRAEFIK_ENTRYPOINTS | all | The routers' entry points, comma-separated, such as websecure. |
The Traefik names (service, resolver, entry points) are letters, digits
and @ . _ -; anything else stops the release at start.
Publishing DNS records
Karta can write its own records of verified sending domains (the
ownership record, the DKIM keys' records, the tracking host's CNAME
record, the records of the MTA-STS policy, the TLS reports' address and
the BIMI logo set in Karta) through a DNS provider
(Publishing records through a DNS provider).
KARTA_DNS_PROVIDER picks it: PowerDNS (the default) or RFC 2136, or a
module from a package compiled into the image
(Writing a DNS provider). Off unless the
selected provider's settings are set. A provider from a package reads its
own variables; add the package at build time with KARTA_EXTRA_DEPS,
below.
PowerDNS
| Variable | Default | Meaning |
|---|---|---|
KARTA_POWERDNS_URL | unset | The API's base URL, such as http://127.0.0.1:8081 (the server's webserver-address and webserver-port). An http or https URL; anything else stops the release at start. |
KARTA_POWERDNS_API_KEY | required with the URL | The server's api-key. |
KARTA_POWERDNS_SERVER_ID | localhost | The server id in the API's paths. |
KARTA_POWERDNS_ZONES | none | The zones Karta may write to, separated by commas, such as example.com,example.org. Karta writes in no other zone, and only for verified domains in these zones or under them. |
The URL and the key are the operator's: no organisation can point Karta
at another server. Give Karta a key of its own where the server allows
it, keep the API off the public internet, and list only the zones whose
domains' records Karta should keep. A zone needs SOA-EDIT-API set
(DEFAULT for zones created through the API) when it has secondaries.
RFC 2136 dynamic update
Any authoritative server that accepts RFC 2136 updates signed with TSIG (BIND, Knot, PowerDNS and others) works the same way. The server must allow updates from Karta with this key in these zones; the key's name, secret and algorithm must match its configuration.
| Variable | Default | Meaning |
|---|---|---|
KARTA_DNS_RFC2136_SERVER | required | The server's host name or address. |
KARTA_DNS_RFC2136_PORT | 53 | Its port. |
KARTA_DNS_RFC2136_ZONES | required | The zones Karta may write to, separated by commas. The server cannot list its zones, so this list is also what list_zones returns. |
KARTA_DNS_RFC2136_TSIG_KEY_NAME | required | The TSIG key's name. |
KARTA_DNS_RFC2136_TSIG_SECRET | required | The key's secret, base64 (as named.conf writes it). |
KARTA_DNS_RFC2136_TSIG_ALGORITHM | hmac-sha256 | hmac-sha256 or hmac-sha512. |
KARTA_DNS_RFC2136_TIMEOUT | 10000 | Milliseconds per exchange, 1000 to 60000. |
Every message is signed and every answer's signature is checked. A UDP
answer with the truncation bit is asked for again over TCP. The provider
keeps Karta's records in an inventory TXT record at
_karta-records.<zone>, so keep that name free; the server raises the
zone's serial and notifies its secondaries itself.
Build-time extra dependencies
| Variable | Default | Meaning |
|---|---|---|
KARTA_EXTRA_DEPS | config/extra_deps.exs | A file that returns the dependencies mix.exs adds to the build, such as a provider's Hex package. Read at build time; its code is part of the image. |
Development and test only
These are read only in the dev or test environments; a release ignores
them.
| Variable | Environment | Meaning |
|---|---|---|
KARTA_DEV_SMTP | dev | 1 starts SMTP listeners on 127.0.0.1 ports 2525, 2587 and 2465 with the certificates from mix karta.gen.dev_ca. |
DATABASE_HOST, DATABASE_PORT | test | Test database host (default localhost) and port (default 55433). |
MIX_TEST_PARTITION | test | Appended to the test database name (karta_test<partition>). |
KARTA_TEST_* | test | Opt-in test suites; see Development. |
KARTA_SCAN_IP | test | Address the TLS scan server (dev/tls_scan_server.exs) binds. |
Settings in the configuration files
These settings have no environment variable. Change them in
config/config.exs or config/runtime.exs (which means building your own
image). Defaults are those of the code.
Outbound (config :karta, Karta.Outbound)
| Key | Default | Meaning |
|---|---|---|
:tls | :opportunistic | TLS for every delivery: :opportunistic or :verified. |
:tls_policies | %{} | Per recipient domain, e.g. %{"bank.example" => :verified, "partner.example" => :dane} (:dane requires DANE). |
:cacerts | the operating system's | Trusted roots for verified TLS. |
:port | 25 | Port delivered to. |
:timeouts | see Delivery | SMTP client timeouts, a map by stage. |
:blocked_networks | the NetGuard's (Karta.NetGuard.default_blocked_networks/0) | Karta.CIDR ranges never connected to, instead of the NetGuard's. |
:max_hosts | 10 | MX hosts looked up per domain. |
:max_targets | 5 | Addresses tried per delivery run. |
:max_age | 432000 (5 days) | Retry period in seconds. |
:destination_limits | KARTA_OUTBOUND_DESTINATION_LIMITS | Limits per destination, as Karta.Outbound.Throttle.parse!/1 reads them. |
:signing | Karta.Domains.KeySource | DKIM key source. |
IP pools (config :karta, Karta.IPPools.Monitor)
| Key | Default | Meaning |
|---|---|---|
:interval | 5000 | Milliseconds between checks of which pool addresses the node holds; nil starts no monitor (and no pool's queue runs on the node). |
:limit | KARTA_OUTBOUND_CONCURRENCY | Delivery jobs at a time in the queue of each pool without its own concurrency. |
SMTP (config :karta, Karta.SMTP)
:listeners (a list of listener options, see below), :certificates (a
list of %{certfile: path, keyfile: path}; one RSA and one ECDSA pair is a
good choice), :spool_dir and :certificate_reload_interval (milliseconds,
default 60000). The environment variables above build one certificate pair
and up to three listeners; more pairs need this setting.
Each listener (Karta.SMTP.Listener) takes:
| Option | Default | Meaning |
|---|---|---|
name, kind, port, hostname | required | kind is :mx, :submission or :submissions. |
ip | :: (all, dual stack) | Address to bind. |
tls | :starttls (:implicit for submissions) | :none is allowed only for mx. |
max_connections | 1024 | Connections for the listener as a whole, shared out among its acceptors (at most this many; 1020 with the defaults). |
num_acceptors | 10 | Acceptor processes. |
max_per_ip | 10 | Simultaneous connections per client (an IPv4 address or an IPv6 /64). |
rate, rate_window | 60, 60000 ms | New connections per client per window. |
exempt | [] | CIDR ranges counted but never limited. |
stress_threshold | 3/4 of max_connections | From this many connections, idle timeouts drop to stress_timeout. |
command_timeout | 300000 ms | Waiting for a command. |
data_timeout | 300000 ms | Waiting for more DATA or BDAT bytes. |
stress_timeout | 10000 ms | Both of the above under stress. |
handshake_timeout | 30000 ms | TLS handshake. |
proxy_timeout | 10000 ms | Reading the PROXY header. |
send_timeout | 30000 ms | A write that does not complete closes the connection. |
max_session_time | 3600000 ms | Hard limit per connection. |
proxy_protocol, trusted_proxies | false, [] | PROXY protocol v2 from these ranges only. |
read_buffer | 65536 bytes | One socket read. |
max_heap_size | 2000000 words | A connection process above this is killed. |
limits | see below | %Karta.SMTP.Limits{}. |
dsn | false | Advertise DSN. Leave off: see SMTP listeners. |
requiretls | false | Advertise REQUIRETLS after STARTTLS. On for the submission listeners only: see SMTP listeners. |
Karta.SMTP.Limits: max_line_length 2048, max_message_size 26214400
(25 MiB), max_recipients 100, max_errors 10, max_rejections 20,
max_auth_failures 3.
Other
| Setting | Default | Meaning |
|---|---|---|
config :karta, :vault_retired_keys | %{} | %{"key id" => "base64 key"}: old vault keys that still decrypt and verify (KARTA_VAULT_RETIRED_KEYS). See key rotation. |
config :karta, Karta.Accounts, session_hours: | 12 | How long a signed-in session lasts. |
config :karta, Karta.Tracking, events_per_minute: | 60 | Opens and clicks recorded per recipient per minute. |
config :karta, Karta.Sending.Options, batch_limit: | 100 | KARTA_BATCH_MAX_MESSAGES: messages per batch request. |
config :karta, KartaWeb.APIAuth, verifications_per_minute: | 60 | Argon2id key verifications per client (IPv4 address or IPv6 /64) per minute, counted across all nodes; :infinity turns the limit off. |
config :karta, Karta.Messages.Retention | interval: 3600000, first_run: 60000, pending_grace: 7200000, batch_size: 500, max_batches: 100 | Retention runs; interval: nil turns them off. |
config :karta, Karta.DNS | Unbound at 127.0.0.1:53, Karta.DNS.Cache | Resolver options timeout (2000 ms), attempts (2), udp_size (1232). |
config :karta, Oban | queues outbound: 10, webhooks: 10 and inbound: 10, prune after 7 days, rescue after 60 minutes, sweep every 15 minutes | The job queue. |
config :karta, Karta.Webhooks | allow_http: false, retention_days: 30 | KARTA_WEBHOOKS_ALLOW_HTTP; days webhook events, their deliveries and requests are kept. |
config :karta, Karta.Webhooks.Sender | timeout: 15000, concurrency: 4, disable_after: 432000 | A webhook request's time limit (ms), requests at once per webhook, and the seconds of failure after which a webhook is switched off. |
config :karta, Karta.NetGuard, allowed_networks: | [] | KARTA_NET_GUARD_ALLOWED_NETWORKS, as a list of strings. |
config :karta, Karta.Inbound | allow_http: false, srs_domain: nil | KARTA_INBOUND_ALLOW_HTTP, KARTA_SRS_DOMAIN. |
config :karta, Karta.Scan | timeout: 5000, max_size: 26214400, rspamd: [], clamav: [] | KARTA_SCAN_TIMEOUT, KARTA_SCAN_MAX_SIZE, KARTA_RSPAMD_URL, KARTA_RSPAMD_PASSWORD, KARTA_CLAMAV_HOST, KARTA_CLAMAV_PORT, KARTA_CLAMAV_SOCKET; checked at boot. |
config :karta, Karta.Bounces, max_age_days: | 30 | KARTA_BOUNCE_MAX_AGE_DAYS: how long a VERP return path is believed. |
config :karta, Karta.Inbound.Dispatcher | timeout: 30000, max_size: 26214400 | An HTTP endpoint's time limit (ms), and the largest message sent to one (bytes). |
Per-server settings
Each mail server has settings of its own, changed on its page in the
admin interface or with Karta.Servers.update_server/2 (see
Managing organisations, servers and keys):
| Field | Default | Meaning |
|---|---|---|
name | required | Display name, at most 100 characters; the slug is made from it. |
retention_days | 30 | Messages older than this are removed (1 to 365). |
retention_size_mb | 2048 | The server's oldest messages beyond this many MiB of stored bodies are removed. |
send_limit_per_minute | unset | Delivery attempts per minute for the whole server. |
track_opens, track_clicks, list_unsubscribe | false | See Tracking and unsubscribe. |
mode | live | Always live; not changed by input (development mode, which holds mail, is not built). |