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.

Adding Email accounts using an external script, yet again

Discussion in 'E-mail Discussions' started by Pedro Monteiro, Jun 25, 2004.

  1. Pedro Monteiro

    Joined:
    Jun 22, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Guys I'm so sorry to bring this up again, but do you guys know if it possible to redirect this script to a costume header?

    I would like the sucess page to differ from the Cpanel sucess page.

    But I can't seem to add a header without getting errors.


    Script by user NAMELESS

    #!/usr/local/bin/php

    <?
    $email = "xxx";
    $udomain = "xxxx.com";
    $upass = "yyyy";
    $quota = 1;

    $host = "zzzzz.com";
    $socket = fsockopen($host,2082);
    if(!$socket)
    {
    print('Socket error');
    exit();
    }
    $user = "qqqq";
    $password = "wwwwwww";
    $authstr = "$user:$password";
    $pass = base64_encode($authstr);
    $in1 = "GET /frontend/x/mail/doaddpop.html?email=$email&domain=$udomain&password=$upass&quota=$quota\r\n";
    $in2 = "HTTP/1.0\r\n";
    $in3 = "Host:$udomain\r\n";
    $in4 = "Authorization: Basic $pass\r\n";
    $in5 = "\r\n";

    fputs($socket,$in1);
    fputs($socket,$in2);
    fputs($socket,$in3);
    fputs($socket,$in4);
    fputs($socket,$in5);
    while (!feof($socket)) {
    echo fgets ($socket,128);
    }
    fclose( $socket );
    ?>
     
  2. Pedro Monteiro

    Joined:
    Jun 22, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
  3. E9N_Michio

    E9N_Michio Member

    Joined:
    Jul 11, 2004
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I am trying to do the same but having trouble using my scroipt i have..
     
  4. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    fputs($socket,$in5);
    while (!feof($socket)) {
    echo fgets ($socket,128);
    }
    fclose( $socket );
    header("Location: http://yoursite.tld");
    ?>

    Try adding the last line.
     
  5. Pedro Monteiro

    Joined:
    Jun 22, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Fwebs, thanks, but naturaly, I had already tried that.
     
  6. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    And you've also tried removing the echo in this line 'echo fgets ($socket,128);' I assume then.
     
  7. Pedro Monteiro

    Joined:
    Jun 22, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Actually, I haven't tried that.

    Thank you very much my friend.
     
Loading...

Share This Page