package uspf
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9f026b759eeade9005e49a8245d9e6416337c53910d707f943b202d7ea473611
sha512=8e34d8ec38f7a00fa27f5080ff37c69548e17a7d8b7a85fa90ba841bad67b978790a57b83772373753ffb1a8e26b2193609463475b8ab524667211023c4591ad
Description
uspf is an implementation of the SPF verifier in OCaml compatible with MirageOS.
Added to opam-repository:
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 uspfHow 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.