SaltDns.MailHealth (Salt v1.0.0)

How healthy a zone's mail is, judged from its own records: MX, SPF, DKIM, DMARC, MTA-STS, TLS reporting, the mail-app discovery records, and whether the sender policy and signing key line up with the mail provider the MX records name.

The answer is a list of findings with a status each — :pass, :warn, :fail or :info — and a summary (red when anything fails, amber when anything warns, green otherwise). Each finding says what was found and what it means in plain words.

What a finding cannot judge from DNS is not guessed: a key that differs from the provider's is a lookup the provider must do, and an MTA-STS policy is a file on a web server. Those findings say so.

A finding that a preset can fix carries fix: {:preset, preset_id, part}; a DKIM record carries fix: :dkim (the key comes from the provider); a TLS reporting address carries fix: :tls_rpt.

The platform's mail settings (SaltDns.Presets.mail_config/0) let the alignment check recognise Kantoor mail; Google Workspace and Microsoft 365 are recognised from their MX names without configuration.

Summary

Functions

Analyses the zone's mail records. state is the zone's rrsets as SaltDns.Import.current_state/1 returns them. Options: :mail, the platform's mail configuration (default SaltDns.Presets.mail_config/0).

The mail provider the MX records name.

How a provider is named in the page.

Types

finding()

@type finding() :: %{
  id: atom(),
  label: String.t(),
  status: status(),
  summary: String.t(),
  detail: String.t() | nil,
  fix: term()
}

status()

@type status() :: :pass | :warn | :fail | :info

t()

@type t() :: %{
  zone: String.t(),
  provider: atom(),
  findings: [finding()],
  summary: %{
    status: status(),
    pass: non_neg_integer(),
    warn: non_neg_integer(),
    fail: non_neg_integer()
  }
}

Functions

analyse(zone, state, opts \\ [])

@spec analyse(String.t(), [map()], keyword()) :: t()

Analyses the zone's mail records. state is the zone's rrsets as SaltDns.Import.current_state/1 returns them. Options: :mail, the platform's mail configuration (default SaltDns.Presets.mail_config/0).

provider(mx, mail)

@spec provider([String.t()], map() | nil) :: atom()

The mail provider the MX records name.

provider_label(provider)

@spec provider_label(atom()) :: String.t()

How a provider is named in the page.