Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    2

    Default Working doaddpop Script.

    Hi,
    I have been looking on the net for a few days now for a working 'doaddpop' script so i can automate the setup of accounts on my server!
    After trying them all i found one!

    Here it is!

    PHP Code:

    $u 
    "cpanelUsername"//your cpanel username
    $p "cpanelPassword"//your cpanel password
    $domain "domain.com"// Your Domain without the http or www.

    // Variables from signup form.
    $username $_POST['username'];
    $password $_POST['password'];

    // QUOTA IS SET TO 100 IN THIS SCRIPT, change it to whatever you like.

    // Register POP Account on cPanel.
    $file fopen("http://$u:$p@$domain:2082/frontend/x/mail/doaddpop.html?email=$username&domain=$domain&password=$password&quota=100""r");
    if (!
    $file
    {
        echo 
    "<p>Unable to open remote file.\n";
        exit;
    // Unable to connect.
            
    while (!feof ($file))
    {
        
    $line fgets ($file1024);
        if(
    eregi("already exists!"$line$out)) 
        {
            echo 
    "That name is in use. Please Try Another name.";
            exit;
        } 
    // If name exists.
    // While.

    fclose($file);

    echo 
    "Email account created!"

    I hope this helps anyone who wants it.
    I thought it would be bad not to post it up for people.

    Jamie.

  2. #2
    Member
    Join Date
    Jan 2003
    Posts
    11

    Default Security risks?

    Is there any way that a user could find the values of $u:$p@ in any logs? Like a router keeping track of all the urls it sent info to?

    I was using $sAuth = base64_encode("Cpanelusername:Cpanelpassword"); and GET for the fputs with the doaddpop.html url but for some reason it stopped working.

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    2

    Default

    Hi,
    The above code still works for me.
    because the script is processed in PHP on the server and the output is only sent to the webbrowser, im sure the passwords cannot be hacked.
    although if there does happen to be a major flaw in your code, then its possible.

    jamie

  4. #4
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    It is a risk you take for the convenience, especially if you d not enable phpsuexec or php_openbasedir protection. If you don't, then it would be trivial for someone who successfully exploits any PHP script on your server to read the account and password details - just something to be aware of.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. doaddpop hook?
    By dorris in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-16-2008, 05:32 AM
  2. Cpanel doaddpop problem
    By chriswatson in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-28-2004, 09:59 AM
  3. doaddpop and doadddomain via php
    By mickie2000 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-03-2004, 07:11 PM
  4. Replies: 0
    Last Post: 03-23-2004, 06:20 PM
  5. Oscommerce script not working
    By aress24x7 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-25-2003, 10:43 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube