Sovite.Core.Supervisor (sovite v0.2.0)

Copy Markdown View Source

Root supervisor of the Sovite MTA.

It loads and validates the configuration before starting anything. With an invalid config, the errors are logged and start_link/1 returns {:error, {:invalid_config, errors}}, so the MTA never runs with a half-valid setup.

To embed the MTA in another application, add it to that application's supervision tree:

children = [
  {Sovite.Core.Supervisor, config_path: "/etc/sovite/sovite.toml"}
]

Options

Children

In start order: the log file handler, the database (migrated before anything else starts), the cache of the domains in the database, the failed-login counter, the certificate store and the ACME client (when TLS is configured), the queue manager, and the listeners. They stop in reverse order, so listeners close first.

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.

start_link(opts \\ [])

@spec start_link(keyword()) ::
  Supervisor.on_start()
  | {:error, {:invalid_config, list()} | {:queue_directory, File.posix()}}