package sendmail

  1. Overview
  2. Docs
type domain = Colombe.Domain.t
type reverse_path = Colombe.Reverse_path.t
type forward_path = Colombe.Forward_path.t
type mechanism =
  1. | PLAIN
  2. | LOGIN
type authentication = {
  1. username : string;
  2. password : string;
  3. mechanism : mechanism;
}
type ('a, 's) stream = unit -> ('a option, 's) Colombe.Sigs.io
type error = [
  1. | `Protocol of [ Colombe.Request.Encoder.error | Colombe.Reply.Decoder.error | `Unexpected_response of int * string list | `Invalid_base64_value of string | `Invalid_login_challenge of string ]
  2. | `Unsupported_mechanism
  3. | `Encryption_required
  4. | `Weak_mechanism
  5. | `Authentication_rejected
  6. | `Authentication_failed
  7. | `Authentication_required
]
val pp_error : error Fmt.t
val sendmail : 's Colombe.Sigs.impl -> ('flow, 's) Colombe.Sigs.rdwr -> 'flow -> Colombe.State.Context.t -> ?authentication:authentication -> domain:Colombe.Domain.t -> reverse_path -> forward_path list -> (string * int * int, 's) stream -> ((unit, error) Stdlib.result, 's) Colombe.Sigs.io

sendmail impl rdwr flow ctx ?authentication ~domain sender recipients mail where:

  • impl is the scheduler (unix, lwt or async)
  • rdwr read/write syscalls
  • flow witness of the flow (can be a socket)
  • ctx context used by the process
  • authentication authentication information used by the process
  • sender sender of the mail
  • recipients recipients of the mail
  • mail stream of the mail

This process try to send a mail according RFC4409. The process should be wrapped into a secured flow (like TLS). For a real use-case of sendmail, you should look into sendmail-lwt which takes care about the TLS layer.

OCaml

Innovation. Community. Security.