Sign inSign up

fogtype/nanashi

By fogtype

•Updated 6 days ago

email alias generator

Image
0

203

fogtype/nanashi repository overview

⁠Nanashi

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.

⁠Usage

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
VariableMeaningDefault
NANASHI_DOMAINDomain of the aliasesrequired
NANASHI_KEYAPI keyrequired (API)
NANASHI_TOAddress the aliases forward torequired (API)
NANASHI_ALIASESFile 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]

⁠maddy

Add the file to table.chain:

optional_step file /etc/aliases

⁠Bitwarden

Pick SimpleLogin as the service. Set Server URL to the public URL of the API and the API key to NANASHI_KEY.

⁠License

GNU AGPL-3.0⁠

Tag summary

Content type

Image

Digest

sha256:e6c3ca988…

Size

3.3 MB

Last updated

6 days ago

docker pull fogtype/nanashi