Adds a pending delivery, due at now; a repeated id preserves the first delivery and its retry state. After purgeContent for the run, a delivery of a content event (a type in
CONTENT_EVENT_TYPES) is not stored: the purge is the outbox's fence. A delivery of any other type (bot:left,
bot:purged, bot:done and the rest) is stored. A mail delivery (kind: 'mail') is content: behind the fence it is
stored empty and dead, and purgeContent empties it with the content events.
Pending deliveries due at now, ordered by nextAt then id ascending, a mail delivery past its expiry left out; default limit 100.
Records a failed attempt: due again after the backoff of nextAttemptAt, or dead a day after the first failed attempt, or at a mail delivery's expiry (its body emptied). A delivery that is no longer pending, delivered or dead, is left as it is.
Optional (the library's stores have it). Ends a pending delivery at once (a destination's permanent refusal, or an outcome the destination never answered), a mail's body emptied; one no longer pending is left as it is. True when the outbox recorded it; false from a wrapper whose outbox cannot, whose caller records a failed attempt instead.
Optional (the library's stores have it). Moves a pending delivery's next attempt to notBefore without counting an attempt (a cap that holds it). True when recorded; false from a wrapper whose outbox cannot.
Optional (the library's stores have it). Ends every pending delivery of the run to the destination (an address that declined), their bodies emptied. True when recorded; false from a wrapper whose outbox cannot.
Optional (the library's stores have it). Ends every pending mail delivery whose expiry has passed at now, dead with its body emptied, so an expired body waits for no attempt; the count ended. OutboxDispatcher calls it at the start of each pass.
Empties every content delivery of the run (a type in CONTENT_EVENT_TYPES), delivered ones included, so a replay
after a purge sends the content-free bot:purged in its place. A delivery of any other type (bot:done,
bot:left and the rest) carries no content and keeps its type and payload. From then on the run takes no content
delivery (see enqueue).
Every delivery of the run, whatever its state, ordered by nextAt then id ascending.
Sends one delivery as the outbox holds it now, not as due returned it: one gone or no longer pending is skipped
(false). The signal send gets aborts when purgeContent purges the delivery's run, so a send that has not written
its body yet stops (false); any other rejection is send's.
A delivery due returned.
Sends the fresh copy under the signal.
Outbound deliveries in memory, for tests and single-process hosts.