package sendmail

  1. Overview
  2. Docs
module Context_with_tls : sig ... end
module type VALUE = sig ... end
module Value : sig ... end
module type S = sig ... end
module Make_with_tls (Value : VALUE) : S with type 'x send = 'x Value.send and type 'x recv = 'x Value.recv and type Value.error = Value.error and type encoder = Context_with_tls.encoder and type decoder = Context_with_tls.decoder
type domain = Colombe.Domain.t
type reverse_path = Colombe.Reverse_path.t
type forward_path = Colombe.Forward_path.t
type mechanism = Sendmail.mechanism
type authentication = Sendmail.authentication
type ('a, 's) stream = ('a, 's) Sendmail.stream
type error = [
  1. | `Tls of [ `Protocol of Value.error | `Tls_alert of Tls.Packet.alert_type | `Tls_failure of Tls.Engine.failure | `Tls_closed ]
  2. | `Protocol of [ `Protocol of Value.error | `Tls_alert of Tls.Packet.alert_type | `Tls_failure of Tls.Engine.failure | `Tls_closed ]
  3. | `Unsupported_mechanism
  4. | `Encryption_required
  5. | `Weak_mechanism
  6. | `Authentication_rejected
  7. | `Authentication_failed
  8. | `Authentication_required
  9. | `STARTTLS_unavailable
]
val pp_error : error Fmt.t
val sendmail : 's Colombe.Sigs.impl -> ('flow, 's) Colombe.Sigs.rdwr -> 'flow -> Context_with_tls.t -> Tls.Config.client -> ?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 tls_config ?authentication ~domain sender recipients mail where:

  • impl is the scheduler (unix, lwt or async)
  • rdwr read/write syscall
  • flow witness of the flow (can be a socket)
  • ctx context used by the process
  • tls_config TLS configuration used by STARTTLS
  • 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. It ensures to use STARTTLS (eg. RFC3207) while the process according TLS configuration tls_config. If authentication is given, it does the authentication only while TLS flow. Mail is sended only while TLS flow.

The stream mail must respects same assumptions as Sendmail_lwt.sendmail.

OCaml

Innovation. Community. Security.