Karta.MTASTS.Refresh (Karta v1.0.0)

Keeps cached MTA-STS policies from lapsing (RFC 8461 §3.3, §10.2). Every hour (an Oban cron job without arguments) it removes the policies that have expired and queues a job per domain whose policy was fetched more than a day ago (at most 1,000 at a time, oldest first; one unfinished job per domain). That job (%{"domain" => domain}) fetches the policy again with Karta.MTASTS.refresh/2, which extends it when it is still published.

It uses the delivery configuration (config :karta, Karta.Outbound: :mta_sts and :dns); with mta_sts: false nothing is fetched.

Summary

Functions

Removes the policies expired at now and, when refresh?, queues a refresh job for each domain due. Returns how many jobs were queued.

Functions

schedule(refresh?, now \\ DateTime.utc_now())

@spec schedule(boolean(), DateTime.t()) :: non_neg_integer()

Removes the policies expired at now and, when refresh?, queues a refresh job for each domain due. Returns how many jobs were queued.