Kantoor.MailServer.Config (Kantoor v1.0.0)

Settings of the IMAP, POP3 and SMTP submission servers. All are OFF by default. Application env (config :kantoor, :imap, ... / :pop3 / :smtp, filled from environment variables in config/runtime.exs) is merged over the defaults below; get/2 also takes overrides (tests).

Common keys: :enabled, :listen (IP tuple), :port (plain listener that offers STARTTLS/STLS), :tls_port (implicit TLS listener), :tls (:ssl server options such as certfile:/keyfile:; without it TLS is unavailable and the implicit listener is not started), :allow_plain_auth (default false: no LOGIN/PLAIN/USER before TLS), :proxy_trusted (CIDR strings of TCP proxies whose PROXY protocol v1/v2 header is believed), :proxy_tls (a connection arriving through a trusted proxy counts as already encrypted: the proxy terminates TLS), :max_connections, :max_connections_per_ip, :auth_timeout_ms, :idle_timeout_ms, :max_auth_failures, :max_bad_commands.

Summary

Functions

Merged settings of :imap, :pop3 or :smtp as a map.

Parsed {ip, prefix} pairs of the trusted proxy CIDRs (invalid entries are dropped).

:ssl server options for STARTTLS/implicit TLS, or nil when TLS is not configured.

Functions

get(proto, overrides \\ [])

@spec get(:imap | :pop3 | :smtp, keyword()) :: map()

Merged settings of :imap, :pop3 or :smtp as a map.

proxy_cidrs(map)

@spec proxy_cidrs(map()) :: [{tuple(), non_neg_integer()}]

Parsed {ip, prefix} pairs of the trusted proxy CIDRs (invalid entries are dropped).

ssl_options(map)

@spec ssl_options(map()) :: keyword() | nil

:ssl server options for STARTTLS/implicit TLS, or nil when TLS is not configured.