Reports Karta sends

Karta sends two reports about other people's mail, the way the big mailbox providers do:

  • a DMARC aggregate report (RFC 7489 §7.2) to the owner of a domain whose mail Karta received, saying which addresses sent mail claiming to be from the domain and whether SPF and DKIM passed;
  • a TLS report (RFC 8460) to the owner of a domain Karta sent mail to, saying how the TLS sessions to its servers went.

Karta reads the same reports when others send them to it; see Receiving mail.

Karta reads the same reports when others send them to it; see Receiving mail.

Switching it on

Nothing is sent until the instance has a reporting identity: an address, and the mail server that sends from it.

KARTA_REPORTS_FROM=dmarc-reports@mail.example.com
KARTA_REPORTS_SERVER=<the server's id>

The address must be at a verified domain of the organisation the server belongs to; the report is an ordinary message sent by that server, so it is authorised, signed with that domain's DKIM keys, delivered and suppressed like any other. Without both settings, or when they do not work, nothing is sent, and the instance administrators' Report sending page says why. The same page adds up the last 30 days (reports sent, held back by the address limit, failed; runs by state; the most frequent reasons runs were skipped or failed) and lists the latest runs with their state and reason.

KARTA_REPORTS_DMARC=false and KARTA_REPORTS_TLS_RPT=false switch a kind off; KARTA_REPORTS_DMARC_EXCLUDE lists domains no DMARC report is sent about (the domain and its subdomains). Configuration lists every setting.

DMARC failure reports (ruf) are not sent: they carry parts of the messages they are about.

DMARC aggregate reports

Every day at about 01:20 UTC Karta plans a report for each domain it received mail from on each of the last two UTC days, and every ten minutes the runs that are due are sent. A report covers one UTC day and one domain: the domain where the DMARC record was found.

  • What is in it. For the mail Karta accepted in the day, one record for each source address, SPF and DKIM result (aligned or not), author domain and envelope sender domain, with the number of messages. Mail Karta refused at SMTP time was not stored and is not counted, so a domain whose policy is reject sees the mail that got through, not the forgeries that were stopped. The envelope recipient is never written: a report does not say which of Karta's customers received the mail.
  • The disposition is always none: Karta accepted the message. A reason says when local policy accepted mail the policy would not have (trusted_forwarder for a valid ARC chain, local_policy otherwise).
  • Where it goes. The rua of the domain's DMARC record, read when the report is sent: mailto: addresses only, at most three. A destination in another organisational domain than the domain's must agree first (RFC 7489 §7.1): it publishes a TXT record <reported domain>._report._dmarc.<destination domain> beginning v=DMARC1. A destination that does not is not sent to. Without this check anyone could name a victim's address in a DMARC record and have Karta mail it.
  • Size. A report holds at most 2,000 records; a domain with more has several reports (-2, -3, ... after the day in the report id). A compressed report over 8 MiB is not sent. At most 1,000 domains are reported on a day, the busiest first.
  • Format. An XML document as RFC 7489 Appendix C defines it, gzipped, attached to a short message. An IPv6 address is written as eight groups, because the schema accepts nothing else.

TLS reports

Karta records every TLS session of the mail it sends (which policy applied to the recipient's domain, MTA-STS or DANE, the result, the MX host and both addresses; see Delivery). The same daily plan makes a TLS report for each domain it had sessions with, and sends it when the domain publishes a TLS-RPT record (_smtp._tls.<domain>, v=TLSRPTv1; rua=mailto:...).

  • What is in it. The JSON of RFC 8460 §4.4: for each policy that applied, the number of successful and failed sessions and a failure detail for each result type, MX host and pair of addresses. At most 1,000 failure details are written, those with the most sessions; the counts include all of them. What Karta noted about a failure is the detail's failure-reason-code, because the RFC's additional-information is a URI and Karta has none.
  • Where it goes. The mailto: addresses of the record's rua, at most three. An https: destination is not used. RFC 8460 has no check like DMARC's for a destination outside the domain, so the limit below is the guard against a record that names a stranger's address.
  • Format. Gzipped JSON, application/tlsrpt+gzip, with the file name, subject and TLS-Report-Domain and TLS-Report-Submitter fields of RFC 8460 §5. Karta keeps the session data for 30 days.

Limits, retries and records

  • An address receives at most 100 reports in 24 hours (KARTA_REPORTS_MAX_PER_DESTINATION); the rest are recorded as limited and not sent. Several domains may name the same address, as report processors ask.
  • A DNS failure, a failure of the send path, or an identity that does not work leaves the run to be tried again after 15 minutes, 1 hour, 4 hours and 12 hours; after five attempts the run fails. A run is taken by one node at a time and a report is sent once even if a node dies while sending: the report's Message-ID is made from the report and the destination, and a run that is taken again looks for it first.
  • Karta keeps the runs and what was sent for 90 days. The report itself is the message it was sent in.
  • karta_report_sent_reports{kind, result} counts sent, limited, failed, skipped and retried reports; nothing in a label names a domain or an address. See Monitoring.