Dovetail v0.0.3 Dovetail

The Dovetail module provides the public API and OTP application implementation.

When the application :dovetail is started, its supervision ensures that dovecot is configured and running. The dovecot server is stopped with the application.

Install

Dovetail.config/0 must be run before first starting dovecot. The :dovecot application ensures configuration, otherwise it must be done explicitly:

iex> Dovetail.config(); :ok
:ok

Examples

iex> Dovetail.up?
false
iex> Dovetail.start()
:ok
iex> Dovetail.up?
true
iex> Dovetail.stop()
:ok
iex> Dovetail.up?
false

Summary

Functions

Await for the dovecot server to start

Create the dovecot server’s configuration, reloading it if dovecot is running

Ensure that the dovecot server is configured and running

Get the user store

Reload the configure by calling doveadm reload

Start the dovecot server with the default settings. This function is

Start the dovecot application

Start the dovecot server with the default settings

Check if dovecot is up

Functions

await(opts \\ [])

Await for the dovecot server to start.

Options

  • :timeout :: int default 5000, the amount of time in ms to await dovecot
  • :interval :: interval default 50, the interval time in ms between dovecot status polls
config(opts \\ [])

Specs

config(Keyword.t) :: {:ok, Keyword.t} | {:error, any}

Create the dovecot server’s configuration, reloading it if dovecot is running.

ensure(opts \\ [])

Specs

ensure(Keyword.t) :: :ok | {:error, any}

Ensure that the dovecot server is configured and running.

See start/0.

get_user_store()

Specs

get_user_store ::
  {:ok, Dovetail.UserStore.t} |
  {:error, any}

Get the user store.

See Dovetail.UserStore.

reload()

Specs

reload :: :ok | {:error, any}

Reload the configure by calling doveadm reload.

start(opts \\ [])

Specs

start(Keyword.t) :: :ok | {:error, :already_started}

Start the dovecot server with the default settings. This function is

Options

  • :config :: String.t the path to the config file
  • :await :: Keyword.t | falsedefault [], if a keyword, use as [await/1`](#await/1)
start(type, args)

Start the dovecot application.

Despite the naming conflict, this function is semantically distinct from start/0 and start/1.

stop()

Start the dovecot server with the default settings.

See doveadm(["stop"]).

up?(options \\ [])

Check if dovecot is up.