How do I recreate the dovecot.pem certificate. I had installed virtualmin with a test hostname and the server now has the proper hostname, but when connecting to the mail server with imap I get a certificate warning stating that the old server name has issued the dovecot cert. I have changed the hostname and mailname to the correct name, but I need to regenerate for dovecot.
Those certs are setup by Dovecot when that package is installed.
You can use Virtualmin to create a new SSL cert, and copy that out to Dovecot.
There’s instructions here on how to add an SSL cert to one of your Virtual Servers:
Once you do that, you’ll be able to go into Server Configuration -> Manage SSL Certificates, and click the “Copy to Dovecot” button,