Sovite.Queue.Record (sovite v0.2.0)

Copy Markdown View Source

Delivery records, appended to a queue file after the message by Sovite.Queue.Spool.append/3.

A queue file is never rewritten. Instead, each delivery attempt appends what happened, and Sovite.Queue.Entry replays the records to get the message's current state:

  • {:recipient, address, status, details} - the outcome of a delivery attempt for one recipient. :delivered and :failed are final; :deferred will be retried.
  • {:notified, addresses} - the sender was told about these failed recipients (or, for a null sender, it was decided not to tell anyone).
  • {:retry, attempts, next_attempt} - the message was deferred after attempts attempts, until next_attempt.
  • :warned - a delay warning was sent.

Summary

Types

Details of a recipient outcome. status is the enhanced status code, reply the remote server's reply or a local diagnostic, remote the server that gave it ("mx.example.com[192.0.2.25]"), and smtp whether reply came from a remote SMTP server.

t()

Types

details()

@type details() :: %{
  status: String.t(),
  reply: String.t() | nil,
  remote: String.t() | nil,
  smtp: boolean(),
  at: DateTime.t()
}

Details of a recipient outcome. status is the enhanced status code, reply the remote server's reply or a local diagnostic, remote the server that gave it ("mx.example.com[192.0.2.25]"), and smtp whether reply came from a remote SMTP server.

status()

@type status() :: :delivered | :failed | :deferred

t()

@type t() ::
  {:recipient, String.t(), status(), details()}
  | {:notified, [String.t()]}
  | {:retry, pos_integer(), DateTime.t()}
  | :warned