Modernize mail server setup

Prelude

Main part

  • Rollout the export tool from #218
  • Replace Postfix by OpenSMTPD on our relaying hosts
  • Switch Dovecot to virtual users
  • Replace Postfix by OpenSMTPD on our main mail server

Aftermath

  • Switch DMARC to reject
  • Add archlinux.org to rspamd whitelistes: https://github.com/rspamd/maps/tree/master/rspamd (spf_dkim + dmarc)
  • Setup ARC
  • Cleanup OpenSMTPD and Dovecot config if possible
  • remove ssh access for users on the mail host
  • Cleanup SPF record (#197 (closed), !229 (merged))
  • Deprecate STARTTLS on Port 587 (0ae67c4a)
  • use floating IPs to keep the spam reputation case we need to migrate the mail server
  • Remove old ip addresses from DNSWL
  • Process DMARC and TLS-RPT reports automatically (#241)
  • Switch MTA-STS to enforce mode (0b87cbfd)
  • Setup blacklist monitoring
  • Setup mails sent, received, bounced monitoring
  • Deprecate POP3 (cf9c92fd)

removed Tasks

Original description:

Our mail server isn't ansibled and it's fairly opaque how everything is setup. Ansible the whole thing, put it on a separate box and modernize it in the process.

Some guides to follow along with a similar stack: https://prefetch.eu/blog/2020/email-server/ and https://poolp.org/posts/2019-09-14/setting-up-a-mail-server-with-opensmtpd-dovecot-and-rspamd/

There's also this: https://wiki.dovecot.org/PasswordDatabase/oauth2

@foxboron mentioned that perhaps OpenSMTPD is inadvisable due to its fairly bad security track record.

Edited by Kristian Klausen