Skip to content

Multi domain support

John Boehr requested to merge jbboehr:multi-domain into master

This is super preliminary, just wanted to get the code in a place where it can be reviewed. Some notes:

  • I opted to go with cfg.domain and cfg.extraDomains over cfg.domains - it simplified the logic in a few places. Notably, in my current implementation, self-signed certs do not support extraDomains.
  • ACME supports all domains using a single certificate - as far as I can tell postfix doesn't have an option to use multiple certs. The certificate is placed in /var/lib/acme/mailserver/ instead of in any domain subfolder. Certs are also issued independently for each domain and placed in the corresponding domain folder. This is so I don't have to re-implement the nginx ACME configurations.
  • I changed the domain that the certs were issued to via ACME due to a conflict with my personal webserver. Only mail.example.com, not example.com will have an nginx virtualhost set up and certs issued.
  • Usernames without a domain will have @${cfg.domain} appended to them - another reason I chose cfg.extraDomains
  • I added a .editorconfig (NixIDEA was having trouble with the indentation) let me know if you want me to remove it.

I've only done minimal testing so far, but it appears to be working on my mail server.

Merge request reports