script to administer e-mail accounts

swiftanswer

Registered
Jun 24, 2002
1
0
151
I am using WHM and Cpanel as a reseller on a shared server.

I am trying to find a way to handle certain routeen email operations without having to log in to the cpanel (i.e. I want these to be site visitor initiated).

Operations that I need are:
Creating an e-mail account
Changing an e-mail password
Sending an e-mail password to the user (i.e. when lost)
deleating an e-mail account

if anyone can point me in the right direction I would apreciate it

Jake Wagner -- www.JWmedia.net
 

rweiss

Well-Known Member
Aug 31, 2002
49
0
156
Ditto #2

I could also use all of these features, plus the ability to add e-mail forwards / autoresponders. I think this could be very useful, especially for importing users from a custom, home-grown system that I have. A Perl module, much like Accounting.pm, would probably be the best way to go.

Anyone else interested in this sort of thing? DarkORB, any chance that this will be happening soon?
 

anand

Well-Known Member
Nov 11, 2002
1,432
1
168
India
cPanel Access Level
DataCenter Provider
[quote:e1fa556238][i:e1fa556238]Originally posted by swiftanswer[/i:e1fa556238]

I am using WHM and Cpanel as a reseller on a shared server.

I am trying to find a way to handle certain routeen email operations without having to log in to the cpanel (i.e. I want these to be site visitor initiated).

Operations that I need are:
Creating an e-mail account
Changing an e-mail password
Sending an e-mail password to the user (i.e. when lost)
deleating an e-mail account

if anyone can point me in the right direction I would apreciate it

Jake Wagner -- www.JWmedia.net[/quote:e1fa556238]

Don't know about the other options you want out how can the email passwords be send to the user ? I mean they are not stored in clean text format on the server so they can just be mailed to the customer ??? Probably you can look for a third party plugin which can basically store all the details and mail it to the customers as when you want it.

regards,

Anand
 

TCSLEA

Active Member
Oct 29, 2003
36
0
156
Austin, T E X A S
The passwords are likely encrypted one-way, and therefore cannot be un-encrypted (and mailed to the user, for instance).

However, here are some php lines that you may find useful:


Adding an email account:

PHP:
fopen("http://$cpanelusername:$cpanelpassword@localhost:2082/frontend/$cpaneltheme/mail/doaddpop.html?email=$newusername&domain=$domain&password=$newpassword&quota=$quota", "r")

Deleting an email account:

PHP:
fopen("http://$cpanelusername:$cpanelpassword@localhost:2082/frontend/$cpaneltheme/mail/realdelpop.html?email=$username&domain=$domain", "r")

Changing a password:

PHP:
fopen("http://$cpanelusername:$cpanelpassword@localhost:2082/frontend/$cpaneltheme/mail/dopasswdpop.html?email=$username&domain=$domain&password=$newpassword", "r")

The cpanel user/pass/theme variables could be set at the top of the php script, and the other variables taken from an html <form>...
 

B12Org

Well-Known Member
Jul 15, 2003
691
1
168
Seattle Washington
cPanel Access Level
Root Administrator
Originally posted by anand

Don't know about the other options you want out how can the email passwords be send to the user ? I mean they are not stored in clean text format on the server so they can just be mailed to the customer ??? Probably you can look for a third party plugin which can basically store all the details and mail it to the customers as when you want it.

regards,

Anand [/B]
Not to mention how are they going to be able to get their new email password by email if they cant login to get it?
 

Pache

Registered
Mar 17, 2004
1
0
151
Originally posted by TCSLEA
The passwords are likely encrypted one-way, and therefore cannot be un-encrypted (and mailed to the user, for instance).

However, here are some php lines that you may find useful:


Adding an email account:

PHP:
fopen("http://$cpanelusername:$cpanelpassword@localhost:2082/frontend/$cpaneltheme/mail/doaddpop.html?email=$newusername&domain=$domain&password=$newpassword&quota=$quota", "r")

Deleting an email account:

PHP:
fopen("http://$cpanelusername:$cpanelpassword@localhost:2082/frontend/$cpaneltheme/mail/realdelpop.html?email=$username&domain=$domain", "r")

Changing a password:

PHP:
fopen("http://$cpanelusername:$cpanelpassword@localhost:2082/frontend/$cpaneltheme/mail/dopasswdpop.html?email=$username&domain=$domain&password=$newpassword", "r")

The cpanel user/pass/theme variables could be set at the top of the php script, and the other variables taken from an html <form>...


When I try running the fopen() it's getting me this error:

Warning: fopen(http://...@localhost:2083/frontend/x2/mail/dopasswdpop.html?email=test&domain=test&password=test): failed to open stream: HTTP request failed! đ{@0C/¸ą˙żÔB0C/ in /home/test/public_html/test2.php on line 2
Why? I've tried to change "http" to "https" and it works, but without any resoult.
Do you have any ideas?
Thank you!