Kantoor.MailServer.Supervisor (Kantoor v1.0.0)

Supervises the IMAP, POP3 and SMTP submission listeners. Nothing runs unless a protocol is enabled (see Kantoor.MailServer.Config), so a deployment that sets no mail-server variables is unaffected.

Each listener is a Thousand Island server; each accepted connection is its own supervised, temporary process, so a crash closes that connection only. A listener that dies is restarted by this supervisor without touching the web endpoint (it is :one_for_one and sits beside it in the application tree).

Options (tests): :name, :imap and :pop3 keyword overrides of the config. Limiter and lock-registry names are fixed, so only one supervisor runs at a time.

Summary

Functions

Returns a specification to start this module under a supervisor.

Pids of the open connection handlers of a listener (diagnostics and tests).

Whether any protocol is enabled in the application config.

Registered name of the connection limiter of a protocol.

Registered name of the POP3 mailbox lock registry.

The bound port of the listener with child id {proto, :starttls | :implicit}.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

connection_pids(supervisor, id)

@spec connection_pids(Supervisor.supervisor(), {atom(), atom()}) :: [pid()]

Pids of the open connection handlers of a listener (diagnostics and tests).

enabled?()

@spec enabled?() :: boolean()

Whether any protocol is enabled in the application config.

limiter_name(atom)

Registered name of the connection limiter of a protocol.

lock_registry()

Registered name of the POP3 mailbox lock registry.

port(supervisor, id)

@spec port(Supervisor.supervisor(), {atom(), atom()}) :: non_neg_integer() | nil

The bound port of the listener with child id {proto, :starttls | :implicit}.

start_link(opts \\ [])