Sovite.Core.TLSReports (sovite v0.6.0)

Copy Markdown View Source

Sends TLS-RPT reports (RFC 8460), when tls_rpt.reports is on.

Sovite.Core.Delivery stores the TLS outcome of every session to a domain's MX hosts: which policy applied (DANE TLSA records, an MTA-STS policy, or none) and whether TLS worked, or why not. Every tls_rpt.report_interval, the outcomes are grouped by recipient domain into one report each (Sovite.TLS.TLSRPT), for the domains that ask for reports with a _smtp._tls TXT record. The gzipped JSON report goes to each mailto: destination as mail from tls_rpt.report_from, DKIM signed when that domain has keys, and is posted to each https: destination. Reported outcomes are then deleted, as are those of domains that do not ask for reports.

Options

  • :repo - the Sovite.Core.Repo reference. Required.
  • :directory - the queue directory. Required.
  • :hostname, :org_name, :from, :contact_info - this server, the organization named in reports, their sender address, and how to reach it. Required.
  • :interval - milliseconds between reports. Required.
  • :queue_manager - told about each queued report, if given.
  • :resolver - for the _smtp._tls records. Defaults to Sovite.DNS.default_resolver/0.
  • :mail_auth - Sovite.Core.MailAuth options, to sign report mail. Not signed without.
  • :post - options for Sovite.TLS.TLSRPT.post/3.

Telemetry

  • [:sovite, :tls_rpt, :report, :sent] - %{sessions}, %{domain, report_id, queue_id, to, urls}
  • [:sovite, :tls_rpt, :report, :skipped] - %{sessions}, %{domain, reason}
  • [:sovite, :tls_rpt, :report, :post_failed] - %{}, %{domain, url, reason}

Summary

Functions

Reports every outcome stored before until, one report per domain. Returns the queue IDs of the queued report mails.

Starts the report sender.

Functions

run(opts, until)

@spec run(map(), DateTime.t()) :: [String.t()]

Reports every outcome stored before until, one report per domain. Returns the queue IDs of the queued report mails.

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the report sender.