Karta.Auth.DKIM.Result (Karta v1.0.0)

The outcome of verifying one DKIM signature, in the terms of Authentication-Results (RFC 8601 §2.7.1), so it can be reported and used by DMARC as it is.

  • result:
    • :pass - the signature verifies;
    • :fail - it does not (body hash or signature mismatch);
    • :policy - it verifies, but Karta does not accept it: an RSA key below the configured minimum (:weak_key), or an l= tag that leaves part of the body unsigned (:partial_body);
    • :neutral - not evaluated (:too_many_signatures);
    • :temperror - the key could not be fetched (a DNS error, or the deadline passed: :timeout); a later attempt may succeed;
    • :permerror - the signature or its key record is unusable.
  • reason - an atom saying why, for anything but :pass.
  • domain, selector, identity, algorithm - from the signature (header.d, header.s, header.i, header.a), nil when it did not parse.
  • b - the signature's b= value without white space (RFC 6008 header.b uses a prefix of it).
  • key_bits, testing (the key record has t=y) and secure (the key record was DNSSEC-validated) - known once the key was fetched.

Summary

Types

result()

@type result() :: :pass | :fail | :policy | :neutral | :temperror | :permerror

t()

@type t() :: %Karta.Auth.DKIM.Result{
  algorithm: :rsa_sha256 | :ed25519_sha256 | nil,
  b: String.t() | nil,
  domain: String.t() | nil,
  identity: String.t() | nil,
  key_bits: pos_integer() | nil,
  reason: atom() | nil,
  result: result(),
  secure: boolean(),
  selector: String.t() | nil,
  testing: boolean()
}