package async_smtp

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val smtp_envelope_info : t -> Async_smtp_types.Smtp_envelope.Info.t

mail_from is called in the event of a "MAIL FROM" SMTP command.

Ok t creates an envelope that is updated by rcpt_to and finally processed by data.

Error err sends the reject (or service_unavailable)

rcpt_to is called in the event of a "RCPT TO" SMTP command.

Ok t augments the envelope in the pipeline and passes it on to the next phase.

Error err sends the reject (or service_unavailable).

val accept_data : state:State.t -> log:Async.Log.t -> Session.t -> t -> t Smtp_monad.t

accept_data is called when the DATA command is received to decide whether or not to accept the message data.

val process : state:State.t -> log:Async.Log.t -> flows:string list -> Session.t -> t -> Async_smtp_types.Email.t -> string Smtp_monad.t

process is called when the message body has been received (after the DATA command and accept_data).

The returned string is used to construct the SMTP reply. Ok str results in "250 Ok: <str>".