Set up a "kill the newsletter" server

Set up a "kill the newsletter" server
Photo by Nijwam Swargiary / Unsplash

Note. The latest release, v1.0.1, has not been merged with main at time of writing, but parts of the README have - super confusing. Use the release branch when checking out the README, example configuration file etc.

See: https://github.com/leafac/kill-the-newsletter/blob/v1.0.1/README.md

  1. Add 2 x DNS records: regular A record and an MX record
  2. Test propagation: https://www.whatsmydns.net/#MX/ktn.example.com
  3. Download latest release executable
mkdir ktn && cd ktn
curl -OL https://github.com/leafac/kill-the-newsletter/releases/download/v1.0.1/kill-the-newsletter--linux--v1.0.1.tgz
tar -xzvf kill-the-newsletter--linux--v1.0.1.tgz

4. Add configuration file configuration.js

5. Hack it to spin up a server running on localhost on a non default port and use nginx to provide the reverse proxy / ssl part

sudo vi ktn.example.com
# for simple reverse proxy see: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-reverse-proxy-on-ubuntu-22-04
sudo ln -s /etc/nginx/sites-available/ktn.example.com /etc/nginx/sites-enabled/ktn.example.com
sudo nginx -t
sudo systemctl restart nginx

6. Add HTTPS: sudo certbot --nginx -d ktn.example.com

7. Update firewall: sudo ufw allow 25

8. Run as a service - grab a copy of the example kill-the-newsletter.service file - remove the "user" part - copy to /etc/systemd/system - then as per the instructions, reload sysctl, enable the service and restart the service

9. Test