val smtp_envelope_info : t ‑> Async_smtp_types.Smtp_envelope.Info.t
val mail_from : log:Async_smtp__.Mail_log.t ‑> session ‑> Async_smtp_types.Smtp_envelope.Sender.t ‑> Async_smtp_types.Smtp_envelope.Sender_argument.t list ‑> t Async_smtp.Smtp_monad.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
)
val rcpt_to : log:Async_smtp__.Mail_log.t ‑> session ‑> t ‑> Async_smtp_types.Email_address.t ‑> t Async_smtp.Smtp_monad.t
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 : log:Async_smtp__.Mail_log.t ‑> session ‑> t ‑> t Async_smtp.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 : log:Async_smtp__.Mail_log.t ‑> session ‑> t ‑> Async_smtp_types.Email.t ‑> [ `Consume of string | `Send of Async_smtp_types.Smtp_envelope.Routed.Batch.t list | `Quarantine of Async_smtp_types.Smtp_envelope.Routed.Batch.t list * Async_smtp.Smtp_reply.t * Async_smtp__.Quarantine_reason.t ] Async_smtp.Smtp_monad.t
process
is called when the message body has been received
(after the DATA command and accept_data
).
Ok (`Consume ok_msg
drops the message and returns a successful response to the
client. It should be used if this plugin has processed the message and does not
intend to relay the message.
Error err
drops the message and returns an error reply to the client. It
should be used when the plugin does not wish to process this message.
Ok (`Send envelopes_to_relay)
spools the given envelopes for further sending and gives
a successful response, once these messages have been safely spooled.
Ok (`Quarantine (envelopes_to_quarantine, reply, reason))
saves the given messages to a
directory for manual inspection and passes through the given reply to the client.
reason
is used only internally to tell us what check failed.