feat: add single-file reference client

This commit is contained in:
randogoth 2026-09-26 11:01:41 +03:00
parent 69ba092179
commit 06249ed244
3 changed files with 884 additions and 0 deletions

View file

@ -53,6 +53,25 @@ uv run smolmaild.py serve
`serve` listens on `127.0.0.1:1961` by default and stores mail in `mail.db`. Use `--host 0.0.0.0` to accept remote connections, and `--invite-token` to close registration. `--help` lists the size, quota, retention and rate limits.
## Reference client
[smolmail.py](smolmail.py) is a complete client in one file, with the same inline dependencies:
```
uv run smolmail.py keygen
uv run smolmail.py trust example.org <server-key>
uv run smolmail.py register alice@example.org
uv run smolmail.py resolve bob@example.org
echo "hello" | uv run smolmail.py send bob@example.org --subject Hi
uv run smolmail.py fetch
uv run smolmail.py list
uv run smolmail.py read <id>
```
`import` adds a contact from a `smol://` address without trusting any server, `contacts` lists known keys and how each was learned, and `rotate` replaces the identity with a signed certificate your contacts accept automatically.
Mail is stored sealed and opened on demand, so the local database holds no plaintext. Superseded keys are retained after a rotation, because mail already addressed to them is readable with nothing else.
## Specification
[SPEC.md](SPEC.md) — wire format, operations, trust model and conformance.