I think this in not simply question.
Because your mail server can use minimum 3 different way for store your users data - system, databases(mysql, postgree and etc), LDAP (ActiveDirectory).
So you must write your own web page (may be on PHP like roundcobe) for creating new users.
So 1 step - detect where your users stored (OS system, DB, LDAP) and then google some like 'PHP script for "creating OS users/write to DB/create LDAP users"