package uspf-mirage

  1. Overview
  2. Docs
SPF implementation in OCaml (with for Mirage)

Install

Dune Dependency

Authors

Maintainers

Sources

uspf-0.0.4.tbz
sha256=86f8969c795ac4ceb31e7c6f4880afaaa47764430e6f0a035343dbec1a1a4827
sha512=1b7ea0d6303bd51ebe35ca2732998d889fa8d62f676730543d9fa45673ef90d36d518fa4cbc7c4da379daa4d43aacc4cdf68907781af4d4ee397d2f1055b1c33

Description

uspf-mirage is an implementation of the SPF verifier in OCaml compatible with MirageOS. It uses LWT as the scheduler.

Published: 27 Oct 2024

README

µSPF, a SPF verifier/signer in OCaml

uspf is a simple library to check or sign an incoming emails from -data. See RFC 7208.

Usage

How to install it?

You must have an OPAM environment. Then, uspf can be installed with:

$ opam install uspf

How to use it?

uspf is a little tool which can be used to verify DNS records from some informations (like where comes from the incoming email - especially, what is the IP address of the sender).

From these informations and the DNS record, we are able to check if the IP address is allowed to send an email under a certain domain-name.

By this way, uspf requires:

  • few informations (the IP address of the sender, its domain-name, etc.)

  • a DNS stack to get records

(* Informations required by uSPF *)
let ctx =
  Uspf.empty
  |> Uspf.with_sender (`MAILFROM address)
  |> Uspf.with_ip ipaddr

(* DNS record *)
let record = Uspf.get ctx sched dns (module DNS)

(* Verification *)
let result = Uspf.check ctx sched dns (module DNS)

From the result, the user is able to emit a new RFC822 field via mrmime:

let field_name, value = Uspf.to_field ~ctx ?receiver result
let () =
  Format.printf "%s: %s\n%!"
    (Mrmime.Field_name.to_string field_name)
    (Unstrctrd.to_utf_8_string value)

uspf has received funding from the Next Generation Internet Initiative (NGI) within the framework of the DAPSI Project.

Dependencies (5)

  1. dns-client-mirage
  2. lwt
  3. uspf = version
  4. dune >= "2.8.0"
  5. ocaml >= "4.07.0"

Dev Dependencies (2)

  1. rresult >= "0.7.0" & with-test
  2. alcotest with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.