Thanks for the IPv6 report: that was a bug in CowSec’s installer. It’s fixed in 0.4.3, and updating adds IPv6 to the edge by itself.
Updating to 0.4.3, no terminal needed:
- In CowSec, open Fresh Hay (Updates) and find the CowSec card.
- Click Check for a new release.
- Click Update CowSec to 0.4.3.
CowSec downloads the release, checks its SHA-256 checksum (it installs nothing if that doesn’t match), then installs it. Only the console restarts while it does: mail and protection keep running. The IPv6 fix is applied as part of the update, so there’s nothing else to do.
Extra sites and tools:
With CowSec, the edge (OpenResty, or nginx on Debian 13) already is the reverse proxy in front of mailcow, so there’s no need to follow mailcow’s reverse-proxy how-to. Add your sites to the edge instead. They then get CrowdSec’s bans and the AppSec web firewall too, at no extra cost.
Create your own file in the edge’s sites/ folder, e.g. imprint.conf. The folder is /usr/local/openresty/nginx/conf/sites/, or /etc/nginx/sites/ on Debian 13. CowSec only ever touches files named cowsec-*.conf, so yours survive updates, and uninstalling CowSec leaves them in place.
For the certificate: if you chose DNS-01 certificates in the wizard, CowSec already has a wildcard for each of your domains and renews it. Use it from /var/lib/cowsec/certs/<your-domain>/.
A static imprint page:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name imprint.example.de;
ssl_certificate /var/lib/cowsec/certs/example.de/fullchain.pem;
ssl_certificate_key /var/lib/cowsec/certs/example.de/privkey.pem;
root /var/www/imprint;
index index.html;
}
A tool on a local port, such as a log viewer. Since it shows your mail logs, keep it to your own network:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name logs.example.de;
ssl_certificate /var/lib/cowsec/certs/example.de/fullchain.pem;
ssl_certificate_key /var/lib/cowsec/certs/example.de/privkey.pem;
allow 192.168.0.0/16; # your own network
deny all;
location / {
proxy_pass http://127.0.0.1:PORT; # the port the tool listens on
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
Then test and reload:
sudo openresty -t && sudo systemctl reload openresty
(on Debian 13: sudo nginx -t && sudo systemctl reload nginx).
Port 80 already redirects every hostname to HTTPS, so there’s nothing to add for it.
If you didn’t choose DNS-01 certificates, the hostname needs its own certificate. Re-running the wizard (sudo cowsec-setup reset-wizard) and switching to DNS-01 is the simplest way to get wildcards.