# MailAuth v0.1.0 - Table of Contents

> Verifies DKIM, SPF and DMARC, signs mail with DKIM, and reads and writes Authentication-Results headers.

## Pages

- [MailAuth](readme.md)
- [Changelog](changelog.md)

- Guides
  - [DKIM](dkim.md)
  - [DMARC](dmarc.md)
  - [SPF](spf.md)
  - [Authentication-Results](authentication-results.md)
  - [DNS](dns.md)

## Modules

- [MailAuth](MailAuth.md): Checks whether an email really came from who it says.
- [MailAuth.Result](MailAuth.Result.md): The result of `MailAuth.authenticate/2`.

- DKIM
  - [MailAuth.DKIM](MailAuth.DKIM.md): DKIM signatures (RFC 6376), with the algorithm rules of RFC 8301 and
Ed25519 keys (RFC 8463).
  - [MailAuth.DKIM.Result](MailAuth.DKIM.Result.md): The result of checking one `DKIM-Signature` header.

- DMARC
  - [MailAuth.DMARC](MailAuth.DMARC.md): DMARC (RFC 9989): checks that a DKIM signature or the SPF check that passed
belongs to the domain in the `From:` address, and reads the policy the
domain publishes.
  - [MailAuth.DMARC.Record](MailAuth.DMARC.Record.md): A DMARC policy record (RFC 9989).
  - [MailAuth.DMARC.Report](MailAuth.DMARC.Report.md): Reads DMARC aggregate reports (RFC 9990), as mail providers send them:
XML, gzip or zip. Reports in the older RFC 7489 format read the same way.
  - [MailAuth.DMARC.Result](MailAuth.DMARC.Result.md): The result of a DMARC check (RFC 9989).

- SPF
  - [MailAuth.SPF](MailAuth.SPF.md): SPF (RFC 7208): checks that the client IP may send mail for the `MAIL FROM`
domain.
  - [MailAuth.SPF.Result](MailAuth.SPF.Result.md): The result of an SPF check (RFC 7208).

- Headers
  - [MailAuth.AuthenticationResults](MailAuth.AuthenticationResults.md): Writes and reads `Authentication-Results:` headers (RFC 8601).
  - [MailAuth.AuthenticationResults.Method](MailAuth.AuthenticationResults.Method.md): One method's result in an `Authentication-Results:` header, such as
`dkim=pass header.d=example.com`.

- DNS
  - [MailAuth.Resolver](MailAuth.Resolver.md): The behaviour for DNS resolvers.
  - [MailAuth.Resolver.Cached](MailAuth.Resolver.Cached.md): A resolver that wraps another one with an ETS cache.
  - [MailAuth.Resolver.Inet](MailAuth.Resolver.Inet.md): A resolver that asks DNS servers with OTP's `:inet_res`.
  - [MailAuth.Resolver.Static](MailAuth.Resolver.Static.md): A resolver that answers from a map, for tests and for checking mail offline.

## Mix Tasks

- [mix mail_auth.dmarc](Mix.Tasks.MailAuth.Dmarc.md): Looks up the DMARC record that applies to a domain, where it was found,
and the organizational domain.
- [mix mail_auth.gen_key](Mix.Tasks.MailAuth.GenKey.md): Generates a DKIM key and prints the TXT record to publish.
- [mix mail_auth.sign](Mix.Tasks.MailAuth.Sign.md): Signs a message with DKIM and prints the signed message.
- [mix mail_auth.spf](Mix.Tasks.MailAuth.Spf.md): Checks whether an IP may send mail for a domain, and shows each record
evaluated on the way through `include` and `redirect`.
- [mix mail_auth.verify](Mix.Tasks.MailAuth.Verify.md): Checks DKIM, SPF and DMARC of a message and prints every result.

