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.

Creating email accounts by user

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

  1. sparty

    sparty Registered

    Joined:
    Mar 18, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I am hosting a domain name for a friend, and he regularly wants to create new email aliases for his domain. Now I am not always there, and he don't know how to do it via cPanel. Is is possible (or is there some kind of script) that he can fill out that the email alias will be created on the server so that he can use it right away without my help?

    Thanks.
     
  2. Pedro Monteiro

    Joined:
    Jun 22, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Use this script, it was provided by a user here -> 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 );
    ?>

    -------------------------------------------------------
     
Loading...

Share This Page