Dovecot

Prerequisite
You will need to have setup Let’s Encrypt before going to this guide.

Create System User
User vmail will be used to store mail related data

If the command complains about the UID or GID being in use, just increment the number. It can be anything between 500 and 999.

Activate
Edit file  and make sure the only included authentication mechanism is passwdfile.

Edit file  and set option

Create file

Add a User
First generate an encrypted password for the user

Now add a line to

Mail Storage
Configuration of the mail storage is done in

Generate Certificate
This part assume that you've setup Let’s Encrypt.

Add your domain to

Add your new certificate to

And finally generate the certificate

Configure
Edit file  and change the following settings

Fail2Ban
Create file  with the following content