The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Auto Add Email Accounts [Stoped Working]

Discussion in 'E-mail Discussions' started by xMichio, Jun 24, 2004.

  1. xMichio

    xMichio Member

    Joined:
    May 4, 2004
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I used a CURL type script to automatically add POP3 accounts to my cPanel, now for some reaosn since cPanel updated i belive it just stopped working, and CURL is still enabled on my APACHE server.. Can anyone possibly help me out in a newer script to addd POP3 accounts?

    Miciho
     
  2. maximusnet

    maximusnet Registered

    Joined:
    Jun 24, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    sorry to be off subject but where can i get this script?

    nik
     
  3. xMichio

    xMichio Member

    Joined:
    May 4, 2004
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Hey, I have this script but it dosent exactly work :s, it just seems to freeze up on me and not run execute the script.. if i get it working ill post it here for you mate

    Michio
     
  4. hellfish

    hellfish Member

    Joined:
    Jun 25, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    post it here anyway, maybe we might find out what is wrong
     
  5. luigi

    luigi Member

    Joined:
    Oct 28, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    by making use of the way cpanel creates the email accounts, you can use this form and script:

    Html form:

    Code:
    <form action=create_email.php method=post>
    Please enter the email address you would like: <input type=text name=username> @yourdomain.com<br>
    Password: <input type=text name=password>
    <input type=submit value="Create Email Account">
    </form>

    php script:
    PHP:
    // change the line below to how many megabytes each account will have:
    $limit 10;

    $username $_POST['username'];
    $password $_POST['password'];
    // change the line below to contain your username and password for cpanel
     
    $sAuth base64_encode("CPANELUSER:CPANELPASSWORD"); 
    //change the 'x' to whatever skin you use - this is the disadvantage of this method.
     
    $sHTTP "GET /frontend/x/mail/doaddpop.html?email=$username&domain=yourdomain.com&password=$password&quota=$limit\r\n HTTP/1.0\r\nAuthorization: Basic $sAuth\r\n"
     
    $hSocket fsockopen("yourdomain.com"2082); 
     
    fputs($hSocket$sHTTP); 
     
    fclose($hSocket);
    echo 
    "$username@yourdomain.com created";

    Obviously adapt it to your needs.

    Hope this helps,

    Rick - XeroHosting
    _________________________
    www.xerohosting.com - customizable and affordable webhosting.
     
  6. hellfish

    hellfish Member

    Joined:
    Jun 25, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    This is great, could how tell me (I'm a newb) hot just change a password of an already created account?
     
  7. luigi

    luigi Member

    Joined:
    Oct 28, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    well through cpanel just log in and go to mail>add/removeaccounts>change password

    If you want a script to do it then you could try changing the line to this:

    PHP:
    $sHTTP "GET /frontend/x/mail/dopasswdpop.html?email=$username&domain=yourdomain.com&password=$password&quota=$limit\r\n HTTP/1.0\r\nAuthorization: Basic $sAuth\r\n"
    I haven't tested this but it should work!
     
  8. xMichio

    xMichio Member

    Joined:
    May 4, 2004
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    hey thanks for that. except what if the email account already exists?
     
  9. hellfish

    hellfish Member

    Joined:
    Jun 25, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I'm sory, I realy forgot to say that I want to do it via php.
    I'm going to try this code that you gave me now
     
  10. hellfish

    hellfish Member

    Joined:
    Jun 25, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    PHP:
    $limit 2;

    $username 'myname@domain.net';
    $password '1234';
    // change the line below to contain your username and password for cpanel
    $sAuth base64_encode("CPANELUSER:CPANELPASSWORD");
    //change the 'x' to whatever skin you use - this is the disadvantage of this method.
    //$sHTTP = "GET /frontend/x/mail/doaddpop.html?email=$username&domain=yourdomain.com&password=$password&quota=$limit\r\n HTTP/1.0\r\nAuthorization: Basic $sAuth\r\n";
    $sHTTP "GET /frontend/x/mail/dopasswdpop.html?email=$username&domain=karmaband.net&password=$password&quota=$limit\r\n HTTP/1.0\r\nAuthorization: Basic $sAuth\r\n";
    $hSocket fsockopen("karmaband.net"2082);
    fputs($hSocket$sHTTP);
    fclose($hSocket);
    Ok this is the code I used to change the password, but nothing happens, just a white screen, no error messages, no nothing... please help :(
     
  11. luigi

    luigi Member

    Joined:
    Oct 28, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    not sure about that one, you'd have to try it! it'll either give an error or change the password+quota or just do nothing.

    your problem here is what you've set to 'username'. This should just be the first part of your email address. Also make sure you've put your cpanel username and password in the appropriate place in the script.

    If you are using a different skin then you'll need to change the 'x' in the url to the right one...

    Hope this sorts it out.
     
  12. quasiman

    quasiman Member

    Joined:
    Aug 26, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Portland, Oregon
    cPanel Access Level:
    Root Administrator
    I had a version of this working, but no longer...using your version, I get the echo; username@mydomain.com has been created, but checking cpanel it hasn't actually been done.

    It seems lucidstorm has found a way around this, but I really don't think I should have to pay for something that was once free. I'm guessing they're passing the url server side instead of through the browser. How to do this I don't know...

    Any ideas??
     
  13. PuReWebDev

    PuReWebDev Well-Known Member

    Joined:
    May 18, 2004
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Orlando, FL.
    Did any of you gentleman actually get your email account creation scripts functioning? I see bits and pieces above, but if you have a functioning copy, if you could please post the entire code, that would be awesome. I'm sure many others besides myself would be very interested.


    Thank You,
    --PuReWebDev
     
  14. KingDrew

    KingDrew Active Member

    Joined:
    Oct 24, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Paris, Texas
    I've created a PHP class which can do more than just e-mail accounts. To grab the file and how to use it, simply go to http://forums.cpanel.net/showthread.php?t=31121. This is easy to follow, even if you're a newbie with PHP. I have yet to make a documentation for it but for now it is self-explanitory. Next time, search the forums ;)
     
  15. PuReWebDev

    PuReWebDev Well-Known Member

    Joined:
    May 18, 2004
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Orlando, FL.

    I actually got your class yesterday, just didn't have an opportunity to mess with it. Thanks for that creation.

    BTW, I'm not a php newbie, lol.

    --PuReWebDev
     
  16. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    What is the version of cPanel?
     
  17. KingDrew

    KingDrew Active Member

    Joined:
    Oct 24, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Paris, Texas
    Looking back at this thread it is about four months old. Didn't realize that until now.
     
  18. mraberration

    mraberration Member
    PartnerNOC

    Joined:
    May 22, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Orlando, FL
    ::
    :::::::::::::::::
     
  19. quasiman

    quasiman Member

    Joined:
    Aug 26, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Portland, Oregon
    cPanel Access Level:
    Root Administrator
    Hey, I just wanted to let everyone on this thread know...I found a pretty cool (FREE!!!) script to add email, ftp, and subdomain users. you can choose within the configuration which or all of those you use. It's fairly easy to modify, and it's not encrypted or anything nuts like that, so you have free reign to do whatever you want with it.

    Check it!
    http://freemans-web.com
     
Loading...

Share This Page