Yo.
I have created my own webmail client for my server but now I need to create a script that can add email accounts to the site.
I want it to be the same thing as the one I use in cPanel (go to page, put info in, click "create", done) but I want it to be web-based and not password protected so ANYONE can create an account (like you would with hotmail or yahoo)
... I need the accounts to be created in exactly the same place as the ones which are created via cPanel.
Problem is, I have no idea how to do this and I can't get hold of the relevant files (I tried stealing the source from the cPanel, but there was alot missing PHP wise)
Could someone either a) point me to a tutorial on this kinda thing, b) point me to where I can download the files which are used to create the accounts (addpop2.html, doaddpop.html, etc - I don't mind if I have to download EVERY file aslong as the email creating files are in there) or c) link me with a ready-made script.
Thanks in advance,
me
Creating POP3 Email Accounts from Web Form
Moderator: General Moderators
-
Terencentanio
- Forum Commoner
- Posts: 27
- Joined: Mon Dec 06, 2004 10:32 am
- Location: England
-
Robert Plank
- Forum Contributor
- Posts: 110
- Joined: Sun Dec 26, 2004 9:04 pm
- Contact:
cPanel uses their own POP program called cppop. But what I would do is create a POP account just for receiving all messages in that domain, and set that as your default address so that anything unroutable goes there.
Have a cron run every minute that reads through all the messages in that account and looks at the headers to see who it's supposed to be delivered to, and add the whole message as a row in a mysql table. Then delete the message from that POP account.
So your webmail client instead of connecting to a POP account will just look on that database for the message associated with that account. You'd have a separate table for the user list and all that. That's how I would do it, that way if cpanel changes the way their program stores info or you move to another server it would all still work.
Have a cron run every minute that reads through all the messages in that account and looks at the headers to see who it's supposed to be delivered to, and add the whole message as a row in a mysql table. Then delete the message from that POP account.
So your webmail client instead of connecting to a POP account will just look on that database for the message associated with that account. You'd have a separate table for the user list and all that. That's how I would do it, that way if cpanel changes the way their program stores info or you move to another server it would all still work.
Imho fetchmail daemon and procmail seem ideal for this kind of tasks...Robert Plank wrote: Have a cron run every minute that reads through all the messages in that account and looks at the headers to see who it's supposed to be delivered to, and add the whole message as a row in a mysql table. Then delete the message from that POP account.