Karta.Reports.Sending.Runner (Karta v1.0.0)

Sends the reports of one run (Karta.Reports.Sending.Run): finds the destinations, builds the reports (Karta.Reports.Sending.Kind), and sends each to each destination as the reporting server, through Karta.Sending, so a report is authorised, DKIM-signed, delivered and suppressed like any message.

A send is not repeated. Each (run, destination, part) is recorded once (Karta.Reports.Sending.Send); a run taken again skips what is recorded. A crash between the send and its record is covered by the report's Message-ID, which is made from the report and the destination: before sending, the server's messages are searched for it, and a message found is recorded as sent instead of sent again.

Limits. An address receives at most max_per_destination reports in 24 hours (Karta.Reports.Sending.settings/0); a send over it is recorded as :limited and not tried again. A compressed report over 8 MiB is recorded as failed.

Outcome of the run. :done when something was sent (or only limited), :skipped when there was nothing to send, no destination or the kind is off, :failed when nothing could be sent. A temporary failure (DNS, the send path, the identity) leaves the run pending at a later time (15 minutes, 1 hour, 4 hours, 12 hours) and, after five attempts, failed.

Summary

Functions

Runs run at now (the :now option, default the clock) and records the outcome in the run. Returns the updated run.

Functions

run(run, opts \\ [])

Runs run at now (the :now option, default the clock) and records the outcome in the run. Returns the updated run.