Sovite.SMTP.Server.Connection (sovite v0.2.0)

Copy Markdown View Source

Runs a Sovite.SMTP.Server.Session on an accepted socket. Started by Sovite.Listener; see Sovite.SMTP.Server for the public API.

The socket is read in active: :once mode, so a client that floods the server only fills the kernel buffers, and every read is followed by the replies to all complete commands in it.

With implicit TLS (RFC 8314), the TLS handshake runs before the greeting. With STARTTLS, it runs when the session asks for it. A failed handshake closes the connection.

On server shutdown, open sessions get 421 4.3.2 before the socket is closed.

Telemetry

  • [:sovite, :smtp, :server, :session, :start] - %{system_time}, %{session_id, remote_ip}
  • [:sovite, :smtp, :server, :session, :stop] - %{duration}, same metadata
  • [:sovite, :smtp, :server, :tls, :stop] - %{duration}, %{session_id, remote_ip, protocol, cipher, sni, error}. error is nil on success, otherwise the :ssl reason, and the other TLS fields are nil.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.