Stalwart
docker compose
services:
stalwart-mail:
image: stalwartlabs/mail-server:latest
container_name: stalwart-mail
ports:
- "8080:8080"
- "25:25"
- "587:587"
- "465:465"
- "143:143"
- "993:993"
- "4190:4190"
- "110:110"
- "995:995"
volumes:
- ./data:/opt/stalwart-mail
restart: always
DNS
It looks like the recommended spf record provided by Stalwart was invalid, had to be replaced with valid syntax. This is what Technitium looks like:
| Name | Type | TTL | Data |
|---|---|---|---|
| @ | A | 3600 | 100.42.179.10 |
| @ | MX | 3600 | Preference: 10 Exchange: mail.privatenode.xyz |
caddy
www.privatenode.xyz {
redir https://privatenode.xyz{uri}
}
privatenode.xyz {
root * /usr/share/caddy
file_server
}
mail.privatenode.xyz {
reverse_proxy 127.0.0.1:8080
}
From /etc/caddy do:
sudo caddy fmt --overwrite
caddy reload
Confirm with sudo systemctl status caddy or sudo journalctl -xeu caddy -f as needed.
Switch to root with sudo su and copy the certs from Caddy into Stalwart:
cat /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/privatenode.xyz/privatenode.xyz.crt > /home/md/docker/stalwart/data/cert/privatenode.xyz.pem
cat /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/privatenode.xyz/privatenode.xyz.key > /home/md/docker/stalwart/data/cert/privatenode.xyz.priv.pem
config.toml
Add the following into /home/md/docker/stalwart/data/etc/config.toml or wherever it's mounted:
server.tls.certificate = "default"
certificate.default.cert = "%{file:/opt/stalwart-mail/cert/privatenode.xyz.pem}%"
certificate.default.default = true
certificate.default.private-key = "%{file:/opt/stalwart-mail/cert/privatenode.xyz.priv.pem}%"
Restart Stalwart container and then log into the web interface at mail.privatenode.xyz.
Do docker compose logs from the dir where docker-compose.yml is located to find the initial admin user/pass, and update the pass.
JMAP
JMAP doesn't work in Ltt.rs Android app. First it asked for a connection URL, which isn't mentioned anywhere.
Per this thread: https://codeberg.org/iNPUTmice/lttrs-android/issues/22, tried a Caddy workaround with a redir:
privatenode.xyz {
redir /.well-known/jmap https://mail.privatenode.xyz/.well-known/jmap permanent
root * /usr/share/caddy
file_server
}
This got rid of the error about a connection URL but then it would not accept the password.
Autoconfig
This worked fine in Thunderbird but not K9 or FairEmail.
API
Documentation for it isn't in yet. Using browser F12 checking network requests going out of the web interface, should start testing with something like a POST request to:
https://mail.privatenode.xyz/api/domain/privacyroot.org