How to let end user change password created by dovecot

all
I’ve followed this link:
https://www.linode.com/docs/guides/email-with-postfix-dovecot-and-mysql/
to setup an email server to host multiple email domains. Everything works fine. I was wondering if anybody knows how to let the email end user to setup their own password when their accounts are created. As it is now, I need to use the command:
sudo doveadm pw -s SHA512-CRYPT
to create a password for an user and then input the password hash to the sql server. In other words, I want to automate this process of changing password through a webpage or online interface. I don’t have much experience of writing encrypted php codes. Is there such software or code snippet already existed ?