Commit graph parsimony/internal
Author SHA1 Message Date
tgiachi
141c5d98e9 feat(dkimsign): sign messages per From domain with RSA or Ed25519 keys
- Add Signer choosing the key by the From address domain: exact match, then parent domains
- Sign list headers too, relaxed/relaxed sha256, never a body length limit
- Load PKCS#1 and PKCS#8 PEM keys, reject unusable files without echoing key material
- Leave messages without a matching key or a usable From untouched
2026-11-09 19:58:07 +01:00
tgiachi
a170204ecb test: close gaps found by mutation checks on the archive import
- Cover the CRLF separator line, cycle roots entered from outside, linear rethreading of long chains
- Cover a read error mid-import, the "and N more" lines, and the mbox content type
- Cover clearing the previous result and the capped error list in the UI
2026-11-09 19:50:40 +01:00
tgiachi
cc47784fdb feat(cli): archive import from a file or stdin
- Add parsimony archive import <list> <file|->, streaming with no overall timeout
- Print imported, already present and failed counts; report failing messages and exit 1
- Support --json
2026-11-09 17:15:43 +01:00
tgiachi
cd596e1810 feat(api): import an mbox into a list's archive
- Add POST /api/v1/lists/{id}/archive/import, streaming the body
- Return a summary of imported, duplicate and failed messages; failures do not fail the request
- Import regardless of the archive policy
2026-11-09 17:15:05 +01:00
tgiachi
45a61ef294 feat(archive): import messages from an mbox
- Add ImportMbox: batches of 200, idempotent by Message-ID, threads rebuilt at the end
- Date fallbacks: Date header, then the From line, then the import time
- Report failed and oversized messages without stopping, keep progress on a read error
- Import regardless of the list's archive policy
2026-11-09 17:14:46 +01:00
tgiachi
ba6c37bc21 feat(mbox,store): mbox reader, batch archiving and thread rebuilding
- Add internal/mbox: streaming reader with strict From_ detection, mboxrd unescaping, size cap and envelope dates
- Add Store.ArchiveBatch: many messages in one transaction
- Add Store.Rethread: rebuild threads from In-Reply-To whatever the insertion order, tolerating cycles
2026-11-09 17:13:56 +01:00
tgiachi
2d8b0ccce6 feat(cli): command-line client for administration
- Add parsimony list, member, held, archive and queue subcommands over the REST API
- Read the token only from PARSIMONY_API_TOKEN; take the URL from --url or PARSIMONY_URL
- Print tables by default and JSON with --json
- Add member import from a file or stdin, reporting failing lines and exiting non-zero
- Require --yes for destructive commands
- Add parsimony serve; keep the old -config invocation working
- Run the CLI inside the container in the end-to-end test
- Test every command against the real API handler; mutation checks over the CLI
2026-11-09 16:57:25 +01:00
tgiachi
6461e77a95 feat: document the queue, close mutation gaps, plain relay errors
- Document delivery semantics, retries and the queue API in the README and OpenAPI
- Add relay.concurrency to the example config
- Test that a relay problem never counts against a member, that the longest-waiting delivery goes first, and the error and limit details
- Show the plain relay error when there is a single batch
2026-11-09 16:04:45 +01:00
tgiachi
98bbcf6b68 feat(api): inspect and discard the outbound queue
- Add GET /api/v1/queue with totals, oldest age and up to 100 deliveries, failing ones first
- Add DELETE /api/v1/queue/{id} to discard a stuck delivery
- Never expose message contents
2026-11-09 15:54:13 +01:00
tgiachi
6c95184adc feat: deliver through the persistent queue
- Router.Deliver queues one entry per recipient atomically; posts are accepted once queued
- LMTP answers 451 only when the database fails, never because the relay is down
- Confirmation mail uses the same queue
- Wire the worker into the daemon: relay.concurrency config, wake on enqueue, interrupt on Close
- Make SMTPRelay honour the context deadline and cancellation on a silent relay
- Test restart survival, relay outage with retry, and Close with a hung relay
2026-11-09 15:53:47 +01:00
tgiachi
b207312cef test(queue): do not depend on the order of concurrent sends 2026-11-09 15:47:46 +01:00
tgiachi
e6713962f9 feat(queue): background worker with retries, backoff and bounded concurrency
- 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
2026-11-09 15:47:14 +01:00
tgiachi
ecbab4d18c feat(outbound): classify relay errors as permanent or bad mailbox
- Add IsPermanent for SMTP 5xx and PermanentError
- Add IsBadMailbox for enhanced status 5.1.x only, so a misconfigured relay says nothing about recipients
2026-11-09 15:46:27 +01:00
tgiachi
092cf4c350 feat(store): durable outbox with shared bodies and retry scheduling
- 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
2026-11-09 15:45:19 +01:00
tgiachi
5a0dd7f6d6 feat(adminui): embed the admin SPA and serve it next to the API
- Add internal/adminui with a SPA handler: index fallback for client routes, immutable caching for hashed assets, 404 for missing assets, security headers
- Answer 503 with a hint when the UI has not been built, so go build always works
- Mount the UI at / and the API at /api/ on the same listener, no CORS needed
- Scaffold admin/ with Vite, React, TypeScript, Tailwind v4, shadcn/ui and Vitest
2026-11-09 15:29:12 +01:00
tgiachi
8f64ac671d feat: serve the public web from the daemon and document the archive
- Add web.listen config (default 127.0.0.1:8081, empty disables)
- Start the public web in app, close it with the rest
- Add end-to-end test: archive stays private, becomes public, hides addresses, one-click unsubscribe works
- Cover mutation survivors: attachments, first text part, multibyte cap, member id 0, page clamp, API limit cap, closing connections
- Update OpenAPI, README and example config
2026-11-09 15:22:50 +01:00
tgiachi
19c845caab feat(web): public archive pages and one-click unsubscribe
- Add list index, paginated archive with search, and message pages with thread links
- Show only lists whose archive policy is public; hide others and foreign messages with 404
- Escape all content and obfuscate email addresses in subjects, senders and bodies
- Add GET confirm page and POST one-click unsubscribe with signed tokens
- Send CSP, nosniff, no-referrer and no-store headers
2026-11-09 15:20:45 +01:00
tgiachi
8253dd608e feat(router): archive accepted posts and add per-recipient unsubscribe links
- Archive the original message on delivery and on release, never when held or rejected
- Log archive failures instead of blocking delivery
- Add List-Unsubscribe per recipient: signed one-click URL and the +leave address
- Add signed unsubscribe tokens bound to their purpose
- Fix the mailto unsubscribe address, +unsubscribe was not a known command
2026-11-09 15:20:01 +01:00
tgiachi
4ac967e001 feat(archive): parse messages into archivable entries
- Decode subject, sender name, date, Message-ID and In-Reply-To
- Pick the plain text body from nested multipart, fall back to stripped HTML
- Decode transfer encodings and charsets, repair invalid UTF-8, cap at 1 MiB
- Synthesize a stable Message-ID when missing
- Never expose a sender address domain; add email obfuscation for public pages
2026-11-09 15:18:23 +01:00
tgiachi
d8275aaa1f feat(store,api): archive with full-text search, threading and archive policy
- Add archive table with FTS5 index kept in sync by triggers
- Deduplicate by Message-ID per list so MTA retries do not repeat posts
- Thread messages through In-Reply-To within the same list
- Quote every search word so user input is never FTS syntax
- Add archive_policy (public, private, off) with migration
- Add API to list, search, read and delete archived messages
2026-11-09 15:17:13 +01:00
tgiachi
7fc1bed7e9 fix(app): do not log closed listener errors on shutdown 2026-11-09 15:13:35 +01:00
tgiachi
952fada19c refactor: move daemon wiring into internal/app and test it end to end
- Add app.Start and App.Close, main only parses flags and waits for signals
- Add end-to-end test: API creates a list, LMTP posts, a fake relay receives VERP copies
- Cover disabled API, bad database, busy port and idempotent Close
- Fix a shutdown race: Close before Serve left the LMTP server blocked
2026-11-09 15:12:51 +01:00
tgiachi
d6a0f6e5a9 test: close gaps found by mutation checks
- Cover the default relay batch size
- Cover partial and total relay failure in Router.Send
- Cover stripping of spoofed List-* headers without a base URL
- Cover the end of the confirmation rate-limit window
2026-11-09 15:09:23 +01:00
tgiachi
ad58789630 feat(api): list policies, held queue and member bounce state
- Add post_policy and join_policy to lists, patchable per field
- Add held message listing, approve and discard endpoints
- Expose disabled and bounce_count on members
- Reject '+' in list names, it is the command separator
- Wire the router release into the daemon
- Update OpenAPI description and README
2026-11-09 15:05:11 +01:00
tgiachi
966b3e0234 feat(ingest): dispatch command addresses and held mail
- Route +join, +leave, +confirm and +bounce addresses before list posts
- Accept held mail without relaying it
- Map invalid tokens and closed lists to 550
2026-11-09 15:04:56 +01:00
tgiachi
91c01bcb83 feat(router): moderation, confirmation commands and VERP bounces
- Hold posts on moderated lists and release them on approval
- Add +join, +leave and +confirm-TOKEN command addresses
- Send one message per recipient with a signed bounce envelope sender
- Disable members after 3 hard bounces and skip them on delivery
- Reject forged bounce addresses and tokens from other lists
2026-11-09 15:04:26 +01:00
tgiachi
9eb4d14a70 feat(store): schema v2 with moderation, pending requests and bounce state
- Add member id, disabled flag and bounce counter
- Add per-list post and join policies
- Add held message queue
- Add expiring, rate-limited pending subscribe and unsubscribe tokens
- Add persistent HMAC secret
- Migrate databases created by milestone 1
2026-11-09 15:03:08 +01:00
tgiachi
1ba42316fd feat: wire REST API into the daemon and document it
- Add api.listen config; token comes from PARSIMONY_API_TOKEN
- Disable the API when the token is not set
- Add OpenAPI description and README usage
2026-11-09 14:57:57 +01:00
tgiachi
7ce6a1c98e feat(api): REST API for lists and members
- Add /api/v1 JSON endpoints: lists CRUD, members add/list/remove, health
- Protect routes with a constant-time bearer token check
- Reject unknown JSON fields and invalid names or addresses
- Map store errors to 404 and 409
2026-11-09 14:57:43 +01:00
tgiachi
e1b0c7666c feat(store): list update, delete, listing and member removal
- Add ListLists, GetList, UpdateList, DeleteList, RemoveMember
- Add ErrExists for duplicate lists
2026-11-09 14:57:13 +01:00
tgiachi
28d22d51de feat: daemon entrypoint, YAML config and Dockerfile
- Add config loader with defaults and strict unknown-field rejection
- Add cmd/parsimony wiring store, router, relay and LMTP server
- Handle SIGINT and SIGTERM for graceful shutdown
- Add Dockerfile and example config
2026-11-09 14:55:38 +01:00
tgiachi
87744a0d97 feat(ingest): LMTP server with per-recipient status
- Add LMTP server routing each recipient through the router
- Relay accepted mail with a list+bounce@ envelope sender
- Reject unknown lists and non-members with 550
- Return 451 on relay or internal failures so the MTA retries
- Cover end to end with a fake relay
2026-11-09 14:54:57 +01:00
tgiachi
dd2818d392 feat(outbound): SMTP relay sender with batching
- Add Sender interface
- Add SMTPRelay sending in batches of 50 recipients per transaction
- Add Fake sender that records messages for tests
2026-11-09 14:52:40 +01:00
tgiachi
d8f31d9b3e feat(router): rewrite headers for list delivery
- Add List-Id, List-Post, List-Unsubscribe and Precedence headers
- Add one-click unsubscribe (RFC 8058) when a base URL is configured
- Strip incoming List-* headers to prevent spoofing
- Rewrite From as "Name via List" and keep the original in Reply-To
- Copy the message body byte for byte
2026-11-09 14:50:56 +01:00
tgiachi
eb9e992f4a feat(router): accept posts only from list members
- Add Router.Route resolving list, checking sender membership
- Return ErrUnknownList and ErrNotMember
- Return subscriber addresses as recipients
2026-11-09 14:47:44 +01:00
tgiachi
015e0bbd0f feat(store): SQLite store for lists and members
- Add schema with lists and members tables
- Add CreateList, FindList, AddMember, IsMember, Members
- Normalize addresses to lowercase
2026-11-09 14:46:35 +01:00