Karta. Outbound. Source
(Karta v1.0.0)
The bytes of a message as they are handed to Karta.SMTP.Client after
DATA: a message held in memory, or a stored message read again as it is
sent.
A stored message is sent as prefix (the DKIM-Signature fields, or
nothing when it is sent unsigned), then its body from skip on — the
header block that the signature replaces, or that was already sent. Each
target of one envelope reads the stored message again, which is what a
message of any size costs: one chunk at a time, never the message.
Summary
Functions
Hands the message's bytes to emit, in order, in pieces of any size:
{:ok, acc} to go on, {:error, reason} to stop. A stored message is
read again from its body for each call (Karta.Storage.stream/4), so a
failed first target does not leave the next one without a message.
A message read from the blob store as it is sent.
The octets of the message as sent, which SIZE and the server's limit are checked against.
Types
@type t() :: binary() | %Karta.Outbound.Source{ message: Karta.Messages.Message.t(), opts: keyword(), prefix: iodata(), size: non_neg_integer(), skip: non_neg_integer() }
Functions
@spec fold(t(), acc, (binary(), acc -> {:ok, acc} | {:error, term()})) :: {:ok, acc} | {:error, term()} when acc: var
Hands the message's bytes to emit, in order, in pieces of any size:
{:ok, acc} to go on, {:error, reason} to stop. A stored message is
read again from its body for each call (Karta.Storage.stream/4), so a
failed first target does not leave the next one without a message.
@spec new( Karta.Outbound.Body.t(), iodata(), non_neg_integer(), Karta.Messages.Message.t(), keyword() ) :: t()
A message read from the blob store as it is sent.
@spec size(t()) :: non_neg_integer()
The octets of the message as sent, which SIZE and the server's limit are checked against.