It is common for some external content scanning software to accept messages over smtp,
scan them, then return them back over smtp with some added headers. This module
coordinates this exchange by starting an smtp server to accept the returned message.
The server that is sent to (using send_receive
) must be configured to send responses
to the correct address (as specified by start_exn
).
val start_exn : Async_smtp.Std.Smtp_server.Config.t ‑> log:Async.Log.t ‑> t Async.Deferred.t
start an smtp server that will be accepting messages back
val send_receive : t ‑> ?timeout:Core.Time.Span.t ‑> Async_smtp.Std.Address.t ‑> Async_smtp.Std.Smtp_envelope.t ‑> Async_smtp.Std.Smtp_envelope.t Core.Or_error.t Async.Deferred.t
send_receive ?timeout addr message
will attempt to send message
to addr
. It
waits up to timeout
for a response message. addr
must send a response that has
the same headers as message
so it can recognized as a response.