- Rate (sends per second, 0 = unlimited) builds one pacer, used right before Sender.Send
- the wait comes before the send timeout starts, so waiting does not eat into it
- a cancelled wait leaves the delivery queued, with no attempt recorded
- tests: 5 deliveries at 2/s take 4 intervals of fake time, rate 0 never waits, retries share the pacer,
cancellation while waiting, and one short real-time test (20 sends at 200/s)
- RunOnce purged failed deliveries (a full scan) on every batch of 50: the Worker now
does it at most once every 5 minutes, by the store clock; a failed purge is retried
on the next run.
- Every recipient re-read the whole message from SQLite: a per-run map msgID -> body,
filled once per message even under concurrency, is dropped when the run ends.
- Tests count purges across batches and after the interval, and body reads per message
(including a missing body) through unexported hooks.
- 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
- Add Worker.RunOnce, Run and Wake over the durable outbox
- Send prefix plus shared message per recipient with a per-send timeout
- Retry temporary failures after 1m, 5m, 15m, 1h, 3h, then every 6h; give up after 3 days
- Drop permanent failures; count a hard bounce only for bad-mailbox replies
- Leave interrupted sends queued on shutdown
- Share the bounce threshold between router and worker