Sovite.Core.QueueInfo (sovite v0.6.0)

Copy Markdown View Source

Reads the queue directory for sovitectl queue and the admin API: lists of queued messages, and the details of one. Everything returned is plain maps, strings, and numbers, ready to be encoded as JSON.

It only reads files, so it works whether or not the MTA runs. The messages are read without checking their checksums; a file that cannot be read at all is listed with an error.

Summary

Functions

The number of messages in each queue.

The messages in queues (by default all), oldest first

The queue message id is in, or nil.

The queues list/2 can list.

The details of message id: its summary, the rest of its envelope (client, HELO name, protocol, login, extension parameters), each recipient's status and last reply, and the message's header section (headers, at most 64 KiB) with its message_id and subject.

Functions

counts(directory)

@spec counts(Path.t()) :: %{required(Sovite.Queue.Spool.queue()) => non_neg_integer()}

The number of messages in each queue.

list(directory, opts \\ [])

@spec list(Path.t(), keyword()) :: [map()]

The messages in queues (by default all), oldest first:

  • queue_id, queue, size (bytes), received_at, sender
  • recipients - how many, and pending, those not delivered yet
  • attempts, next_attempt, and reason, the last error of a pending recipient
  • priority, and release_at for a message on hold for FUTURERELEASE

Options: :queues, and :limit, the most messages returned.

locate(directory, id)

@spec locate(Path.t(), String.t()) :: Sovite.Queue.Spool.queue() | nil

The queue message id is in, or nil.

queues()

@spec queues() :: [Sovite.Queue.Spool.queue()]

The queues list/2 can list.

show(directory, id)

@spec show(Path.t(), String.t()) :: {:ok, map()} | {:error, :not_found | term()}

The details of message id: its summary, the rest of its envelope (client, HELO name, protocol, login, extension parameters), each recipient's status and last reply, and the message's header section (headers, at most 64 KiB) with its message_id and subject.