package async_smtp
Module P.Session
val connect :
state:State.t ->
log:Async.Log.t ->
local:Async.Socket.Address.Inet.t ->
remote:Async.Socket.Address.Inet.t ->
t Smtp_monad.tconnect is called when a client first connects, before any messages are accepted.
Ok session accepts the connection, creating a session.
Error err terminates the connection, sending the reject (or service_unavailable).
val greeting : t -> stringgreeting to send to clients after the connection has been accepted.
val helo : state:State.t -> log:Async.Log.t -> t -> string -> t Smtp_monad.thelo is called in response to initial handshakes (i.e. HELO or EHLO).
Ok session allows the SMTP session to continue.
Error err terminates the connection, sending the reject (or service_unavailable).
extensions that are supported including the associated implementations. It is assumed that this will only change after connect, helo and Start_tls.upgrade_to_tls.
val disconnect : state:State.t -> log:Async.Log.t -> t -> unit Smtp_monad.tdisconnect is called when an SMTP connection is closed. It allows the plugin to cleanup any resources associated with this session