Nanashi makes random email aliases for Bitwarden through a SimpleLogin-compatible API. It appends each alias to /etc/aliases, which maddy reads as an alias table.
Print one random address and exit:
NANASHI_DOMAIN=mail.example ./nanashi
Run the API:
NANASHI_KEY=... NANASHI_DOMAIN=mail.example [email protected] ./nanashi --listen 127.0.0.1:8080
| Variable | Meaning | Default |
|---|---|---|
NANASHI_DOMAIN | Domain of the aliases | required |
NANASHI_KEY | API key | required (API) |
NANASHI_TO | Address the aliases forward to | required (API) |
NANASHI_ALIASES | File to append to. Nanashi needs write access. | /etc/aliases |
The container image runs as UID 65532 and needs the same arguments. Mount the host file and let that UID write it:
docker run -p 8080:8080 -v /etc/aliases:/etc/aliases -e NANASHI_KEY=... -e NANASHI_DOMAIN=mail.example -e [email protected] fogtype/nanashi --listen :8080
Test it:
curl -i -X POST 'http://127.0.0.1:8080/api/alias/random/new?hostname=shop.example' \
-H "authentication: $NANASHI_KEY" \
-H 'content-type: application/json' \
-d '{"note":"Website: shop.example. Generated by Bitwarden."}'
HTTP/1.1 201 Created
Content-Type: application/json
{"alias":"[email protected]","email":"[email protected]"}
A wrong key gets 401 and {"error":"Wrong api key"}. /etc/aliases gets two new lines:
# 2026-10-31T21:37:47+09:00 Website: shop.example. Generated by Bitwarden.
[email protected]: [email protected]
Add the file to table.chain:
optional_step file /etc/aliases
Pick SimpleLogin as the service. Set Server URL to the public URL of the API and the API key to NANASHI_KEY.
Content type
Image
Digest
sha256:e6c3ca988…
Size
3.3 MB
Last updated
6 days ago
docker pull fogtype/nanashi