User creation and user remove process is delaying

How can I streamline the time-consuming tasks involved in managing Mail-in-a-Box, such as creating and removing DNS records, and managing user accounts? Are there any recommended automation methods, scripts, or best practices that could help speed up these processes?

there is API for that
Examples can be found at the end of admin pages.

for example to add new user:
curl -X POST -d “email=new_user@mydomail.com” -d “password=s3curE_pa5Sw0rD” https://mail.mydomain.com/admin/mail/users/add

Scripts you must write itself, according to your needs.

Just disable two factor authentication. I could not figure out the syntax when 2FA is enabled.