Welcome to WebmasterWorld Guest from 184.108.40.206
However, if the users are stored in something else, like LDAP, MySQL, Postgres, or what have you, using PHP to add/edit/delete users should be a snap. In fact the mail server I set up uses MySQL as the user store, and writing a quick PHP app to allow users to add/edit/delete accounts and aliases to their domains was easy.
You do have to make sure that whatever user PHP sees the system as (quite often "apache") has permissions to do whatever your script needs to do.
Remember that you don't have to limit yourself to PHP internal functions; you can use the program execution functions to fire off shell scripts that can then perform any kind of automation task you want.
This is VERY dangerous to do in an application out in the open on the Internet. Never do system calls from PHP if you can help it, especially to add/edit/delete user accounts on a system!
As for the original question, brendan3eb, it looks like you need to do a little researching on how IMAP accounts work. It all depends on your set up, there is no one way it works on everything.
Adding e-mail addresses to a database and having a cron job run through it and add accounts to the system is probably the safest, that way it separates the end user from the actual function of adding an account. Like I mentioned before, adding an IMAP account to a system all depends on how your e-mail server is set up. Try to find out how to add a new IMAP account before choosing your method for allowing users to obtain new accounts from a web site.