You can convert a server from cppop or Courier IMAP to dovecot by running the following command:
Most relevant configurations can be made via WHM > Mailserver Configuration, but you can also change these via the config templates. You generally have to save the config via WHM at least once to generate the template file, if you don’t already have one you can copy in place.
The config template for Dovecot is stored in /var/cpanel/conf/dovecot/main.
After making changes run /scripts/builddovecotconf and the configuration file will be updated.
If the directives you want to use in the dovecot.conf file do not exist in the template, copy the /var/cpanel/templates/dovecot1.1/main.default (folder name may vary per version) template file to one named main.local. Make the modifications to main.local then run /scripts/builddovecotconf to regenerate the final configuration file. Your new template will be used each time the Dovecot configuration file is rebuilt in the future.
When using this method please note that updates to the dovecot binaries may require matching updates to the dovecot template file. The dovecot update system does not touch the main.local template in any way, and it is the responsibility of the administrator to reconcile cPanel’s template changes in main.default with the site specific main.local template.
A useful command when customizing the Dovecot configuration file is dovecot -n. This outputs the configuration being used by the current Dovecot process. Using this, you can verify that Dovecot is using all the directives you added to the configuration.