- Rename the priority helper to priorityEnv and set the publishers policy through SetPolicies instead of raw SQL
- Fixes the duplicate newsletterEnv after merging the publishers and posts branches
- a caller that gives up must not release a slot when another caller reserved after it
- a delivery that did not get its slot is not counted in the run's stats
- the typed address is trimmed before it is used
- Retry-After rounds up to whole seconds
- the hour ends after exactly an hour, and the sweep forgets such an address
- found by mutation testing: these edges survived the first tests
- posts ls <list> [--limit N] prints ID, DATE, SUBJECT, RECIPIENTS, SENT,
PENDING, FAILED and DROPPED, newest first, "No posts yet." when empty,
and the API's JSON with --json
- cells go through the same control-character escaping as the other
tables; tests for the table, the limit, JSON, errors and escaping
- GET /api/v1/lists/{id}/posts?limit= returns id, message_id, subject,
created_at, recipients, sent, failed, dropped and pending, newest
first; 404 for an unknown list, 400 for a bad limit, token required
- discarding a queued delivery counts it as dropped (store.DropOutbox)
- openapi: the new path and the discard note
- member add --publisher makes a publisher, --publisher=false demotes; without
the flag an existing member keeps its role
- member ls has a ROLE column: publisher or subscriber
- new member set <list> <email> --publisher=true|false (usage error without the flag)
- member import reads an optional third column, the keyword publisher (any case);
anything else there fails that line; an empty third column is ignored
- list set --post publishers; help text updated
- the old import test now uses the publisher keyword in its third column
- Deliver and Release (through outbound) queue the deliveries of a list
whose post policy is publishers with priority 1, everything else 0;
confirmation mail stays 0
- tests for Deliver, Release, confirmation mail and the recorded post
- the member DTO carries publisher
- POST /lists/{id}/members takes an optional publisher: absent leaves the flag
of an existing member alone, true or false sets it
- PATCH /lists/{id}/members/{address} with {"publisher": bool}: 404 for a
non-member, 400 when the field is missing
- the list PATCH accepts post_policy publishers; the validation message says so
- openapi updated
- a delivery the relay accepted completes as sent, one given up as
failed, one to a missing mailbox (or with a missing body) is dropped
through store.DropOutbox; a retry changes nothing
- tests: each outcome of a post, giving up after MaxAge, a missing body,
and discussion mail sent before a bigger newsletter queued earlier
- GET /subscribe/{address}: email field, an off-screen honeypot named website,
a Subscribe button; 404 (the usual page) for a private, closed or unknown list
- POST /subscribe/{address}: one plain ASCII address of at most 254 characters,
else the form again (400) with the escaped typed value; a filled honeypot gets
the success page and nothing happens; otherwise Router.RequestJoin and always
the same neutral page, so a member, a rate limited address or an unknown
one cannot be told apart; the body is limited to 4 KiB (413)
- at most 10 POSTs per hour per TCP peer address (X-Forwarded-For is ignored),
then 429 with Retry-After; idle addresses are swept; the clock is injectable
- a Subscribe link on the archive page of a list that qualifies, nothing else
- no-store on the subscribe pages; the CSP is unchanged
- tests for each of these, including escaping, enumeration, the limit and its expiry
- 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
- one line of wiring, a commented example in parsimony.example.yaml
- tests: with a rate of 20/s eight deliveries to a sink take at least 350 ms, without a rate they are not paced
- float, default 0 (unlimited); negative, NaN, infinite or non-numeric values are refused with an error naming the key
- tests with 14, 0.5, 0, 1e2 and -1, .nan, .inf, nan, fast, lists
- 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)
- newPacer(perSecond, now, sleep): strictly spaced slots, no burst, safe for concurrent callers
- Wait reserves the next slot under a mutex and sleeps outside it
- a cancelled caller gives its slot back when it is the last one; a cancelled context returns at once
- a rate that is zero, negative, NaN or infinite means no pacer; a very low rate is capped at one interval of a year
- tests with an injected clock and sleep
- Route on a publishers list lets through a member flagged publisher, after the
unchanged discard and loop checks, and applies the usual From header check
- anyone else gets the new ErrNotPublisher: never held, archived or queued
- ingest answers ErrNotPublisher with 550 5.7.1 only the publishers of this list may post
- tests: publisher ok, plain member and stranger refused, disabled publisher posts,
identity mismatch held and released, discard rules first, other policies unchanged
- members.publisher column, added to old databases by an additive migration
- Member.Publisher, SetPublisher (ErrNotFound for a non-member) and IsPublisher
- a publisher disabled by bounces is still a publisher
- AddMember keeps the publisher flag of an existing member
- SetPolicies accepts the publishers post policy
- RequestJoin(listAddress, addr) reuses join: the same open-policy check, the
silence for active members, the confirmation mail and the store rate limits
- it returns nil for an unknown or closed list, a member and a rate limited
request, and an error only for internal failures
- tests: confirmation mail and confirming it, nothing revealed, a bounce
disabled member can rejoin, a database failure is reported
- Show the mark on every page, linking to the index, inline so the CSP needs no image source
- Add the favicon as a data: URI and allow img-src data: only
- the transport could dial a connection and never use it; the HTTP
server's graceful shutdown waits 5 s for such a connection, which made
the Close tests flaky under -race
- the call and fetch helpers now open one connection per request
- router: an approved post is remembered, so the MTA's copy is refused
- store: a post with no recipients stores no message body
- app: an API request in flight during Close gets its answer
- app: finished LMTP sessions leave the connection tracker
- router: drop a TrimSpace on the Message-ID that net/mail already does
- printable() shows C0, DEL and C1 control characters (except tab and newline; CRLF counts
as a newline) as \xNN / \uNNNN, applied to every table cell, archive show, member
listings, import reports and error text, so an escape sequence in a subject cannot
drive the terminal.
- The client refuses to send the bearer token over http:// to a non-loopback host unless
--insecure is given: usage error, exit 2. localhost, 127.0.0.0/8 and ::1 stay allowed.
Offline commands (dkim) never build the client, so they are not affected.
- Tests: the helper, ESC sequences in archive ls/show, held ls, queue ls, list/member names,
API errors and import reports; the URL check by flag and PARSIMONY_URL. README updated.
- api: empty names, '{' in a name, 253/254-character domains, title trimming and the name fallback
- config: an empty query or fragment in base_url
- router: leaving works on a list closed to new members
- store: an expired token is removed when presented
Close cut the LMTP connections while their handlers still ran, so a post
committed to the queue could lose its 250 and be sent again by the MTA.
- Close stops accepting, waits for the LMTP Serve loop to return, then
calls smtp.Server.Shutdown and http.Server.Shutdown with one shared
deadline (shutdownTimeout, 30 s)
- when the deadline passes, the LMTP connections still open are cut
through a tracking listener (smtp.Server.Close is a no-op once Shutdown
began) and the HTTP servers are closed
- the queue worker and the store stop only after that
- tests: a post in flight during Close is queued and gets its 250; a hung
client is cut after the grace period; the open-connections test uses a
short grace period
- the API + admin UI server and the public web server get ReadTimeout 30s,
WriteTimeout 60s and IdleTimeout 120s next to ReadHeaderTimeout
- the archive import extends its own read and write deadlines to 30
minutes with http.ResponseController, so a big mbox is not cut
- tests: a stalled body and an idle connection are cut on both servers,
an import longer than the default timeouts succeeds, fields are pinned
- README: document the limits and timeouts
name(<=30) + "+confirm-" + 20 = 59 characters, inside the 64 of a local part
(a 30-character name with the old 32-digit token made 71).
- store: CreatePending makes an 80-bit token
- tests: a 30-character list name keeps the confirm and the VERP bounce address (12-digit id) within 64,
and the shorter token still confirms
- discardReason drops only the own-List-Id loop, Auto-Submitted: auto-replied and Precedence: auto_reply; auto-generated, auto-notified and unknown values take the normal path (membership, From, moderation)
- join, leave and confirm commands ignore (250, token kept) a null sender, any Auto-Submitted other than no, Precedence auto_reply/bulk/junk and the list's own List-Id
- tests: loop_test, new auto_test, ingest LMTP test
- README: loops and robots paragraph in the security notes
- store: ConfirmPending claims the row (DELETE ... RETURNING), applies join or leave and commits in one
transaction; a refusal from check, a database error, a token of another list or a rollback leaves the
token usable; concurrent confirmations of one token apply exactly once
- store: CreatePending purges pending rows older than the 72 h TTL
- store: IsActiveMember
- router: confirm uses it, the list policy check runs before anything is consumed
- router: +join from a member disabled by bounces sends the confirmation; confirming re-enables it
- tests: purge, refusal, forced database error, other list, expiry, 8 concurrent confirms, whole rejoin flow
- cli test: the create error text changed with the new name rule
- readLine now holds at most max(limit+1, 1024) bytes of a line and reports its full
length; the rest is read and thrown away, so a single 25 MiB line is no longer read whole.
- The message size is counted from the reported line lengths (after restoring >From),
so the limit is unchanged for normal input.
- Tests: a line over the limit mid-file, at the end of the input and before the first
separator, long lines under the limit, a tiny limit, exact boundary, readLine itself.
- store: migrateMembersV1 renames, creates, copies and drops inside a transaction
- test: a copy that fails on an orphan row leaves the old members table with its rows and no members_v1
- Add the four list-management headers to the list that is already stripped on the way in.
- Drop the author's DKIM-Signature (broken by our header and From changes) and any
Authentication-Results / ARC-* header from outside.
- Tests: every dropped header, repeated ARC headers, and similarly named headers kept.
- message/global-delivery-status (RFC 6533) counts like delivery-status.
- Only the first delivery-status part is read.
- A malformed delivery-status part does not count.
- Drop the redundant empty-boundary check: the multipart reader already
fails on it.
- map router.ErrDuplicate to 250, like a discarded post: the post was
already queued, so the MTA must stop retrying
- test that a post delivered twice over LMTP is queued once
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
- config: empty is fine; otherwise https with a host, http only for localhost/127.0.0.1/::1, no
userinfo, query, fragment or whitespace; the error names base_url
- test: accepted and refused URLs
- docs: README states the rule
- 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.
- walk at most 10 nested multipart levels and 100 parts, then use what
was found: the post is still delivered, the archive stores less
- read a text part only while it can still become the body, and stop at
the first non-blank plain part, so memory stays near MaxBody
- a Date more than 24 hours after the time of parsing becomes that time;
a Date before 1990 is treated as missing
- tests: 20000-level nesting finishes fast, exact limits, allocation
bound, pathological HTML, date clamps