- posts table: one row per post queued to a list (message id, subject,
time, recipients, sent, failed, dropped), deleted with the list and
forgotten after 400 days when a new post is recorded
- EnqueuePost and EnqueueFromHeld record the post in the same
transaction and stamp every delivery with its id; a refused duplicate
records nothing; other mail keeps post_id 0
- CompleteOutbox counts sent, the new DropOutbox counts dropped and
FailOutbox counts failed, each in the transaction that changes the
delivery; a delivery that already failed is never counted twice
- outbox priority column; DueOutbox orders by priority, next_at, id
- ListPosts newest first (default 50, at most 200) with Pending derived
- additive migration of the outbox columns, tested on an old database
When the reply to a delivered post is lost, the MTA sends the post again
and every member got it twice. The list now remembers the posts it queued.
- store: new delivered table (list id, post id, time), created with
CREATE TABLE IF NOT EXISTS and dropped with its list
- store: EnqueuePost records the post and queues it in one transaction,
returns ErrDuplicate when the list queued it in the last hour, and
purges older records
- store: EnqueueFromHeld records the post too, without refusing it: an
approval always delivers
- router: Deliver uses EnqueuePost and logs a duplicate; the post id is
the Message-ID, or a SHA-256 of the message when it has none
- router: Release passes the post id to EnqueueFromHeld
- tests for duplicates, other ids and lists, expiry on the store clock,
atomicity, posts without Message-ID and approvals
- Add failed deliveries: a permanent refusal by the relay (policy, size, line length) or the 3-day give-up marks the delivery failed, with the reason, and never retries it
- Keep failed deliveries listed for a week, then purge them and their stored message
- A non-existent mailbox still drops the delivery and counts a hard bounce
- Migrate the outbox table
- Release removes the held message and queues its deliveries in one transaction
- Of several simultaneous approvals one wins, the others get 404
- Extract the thread-root computation and test its linearity without the database (fast under -race)
- Add outbox_msgs and outbox tables
- Enqueue every recipient of a post in one transaction
- Add due, list, complete, retry and stats queries
- Delete the shared body with the last recipient