First, this question is assuming that there is a working method for interacting with a Mail Server in this fashion. If it's not, please feel free to let me know. Second, I'm relatively new to working with Mail Servers, so any related reading materials would be greatly appreciated.
I'm working on a project that allows the creation of online stores using top-level domains. The solution is rather robust and I'm happy with how it's come out. However, the need has come to allow users who use top-level domain names for their stores to also host their email with us. The solution has a built in messaging center that I'd like to utilize, which is currently using MySQL for message storage (similar to the messaging systems on various social networking sites). I've been reading on working with POP in PHP, and integrating in that way shouldn't be an issue. However, I'm running into a wall when it comes to the actual mail account creation and management, as there seems to be little to no accessible (on the web) learning material on the subject.
In my ideal situation, upon a new user registration, I'd like to use the username and password that they've chosen as their account access credentials to setup a default user on the mail-server, and provide an interface within the solution to add, remove, and modify users on the mail server, which I would then access via a POP mail application/interface.
Here's what I'm working with: I'm hosting with MT, running QMail, PHP 5.2, MySQL 4, and Apache on a Linux server. I have shell access (root), and can modify any necessary root files. Also, I'm allowing users to point domains to their stores via A-Records as well as by NS records. I'm assuming that I'll need to ask them to point their domain's MX records to my mail-server address in order for this to work?
What I'm looking for is a place to start looking and learning. Reading materials, tutorials, case-studies, etc. Whatever you can send over to help me get closer to my goal. Also, if the method I've described above is flawed, or you can recommend a better method, I'd be willing to hear your thoughts on that as well.
Feel free to use this thread as an open discussion on the topic as well (though, I'd like answers and suggestions to be a first priority).
Thanks! :)