Module Async_smtp__Server.Make.1-P.Session

type t
val connect : log:Async_smtp__.Mail_log.t ‑> local:Async_smtp_types.Smtp_socket_address.t ‑> remote:Async_smtp_types.Smtp_socket_address.t ‑> t Async_smtp.Smtp_monad.t

connect 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 ‑> string

greeting to send to clients after the connection has been accepted.

val helo : log:Async_smtp__.Mail_log.t ‑> t ‑> string ‑> t Async_smtp.Smtp_monad.t

helo 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).

val extensions : t ‑> t Plugin.Extension.t list

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 : log:Async.Log.t ‑> t ‑> unit Async_smtp.Smtp_monad.t

disconnect is called when an SMTP connection is closed. It allows the plugin to cleanup any resources associated with this session