I wrote this script during the grueling process of installing and setting up an email server. It perfectly reproduces my successful steps to ensure the same setup time and time again, now with many improvements.
I'm glad to say that dozens, hundreds of people have now used it and there is a sizeable network of people with email servers thanks to this script.
I've linked this file on Github to a shorter, more memorable address on my website so you can get it on your machine with this short command:
curl -LO lukesmith.xyz/emailwiz.sh
When prompted by a dialog menu at the beginning, select "Internet Site", then give your full domain without any subdomain, i.e. lukesmith.xyz.
Debian (and derivatives) specific.