I'm a bit confused how mail servers work, and the process of setting them up. Say I have an domain called example.com, and I have an A record for it. I'll be using postfix/dovecot for this setup along with an SSL certificate.
When setting all this up, do I create a new A record for mail.example.com, as well as a MX record for mail.example.com, and assign the cert to mail.example.com, even though all mail is being sent to example.com accounts? Will this work, or does everything need to be pointed to just example.com?
In all the documentation I've read, everything says set up the mail server as a subdomain, and assign all the hostnames, MX records, A records (for webmail), and SSL certs to that. Just want to make sure I'm on the right path here.