Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    29

    Default POP account creation script. Runs fine on Win2000, not on Linux.

    I posted the same matter at WHT. But as I have not been able to get my answer, I am posting it here now.

    PHP Code:
    <? 
    $host 
    "hostname"
    $socket fsockopen($host,2082); 
    socket_set_timeout($socket,30); 

    $cpaneluser "cpanel_username"
    $cpanelpass "cpanel_password"
    $authstr "$cpaneluser:$cpanelpass"

    $domain "domainname"
    $email="desired_username"
    $password="desired_password"
    $quota=10

    $pass base64_encode($authstr); 
    $in "GET /frontend/bluelagoon/mail/doaddpop.html?email=$email&domain=$domain&password=$password&quota=$quota HTTP/1.0\r\nAuthorization: Basic $pass \r\n\r\n"
    print 
    $in

    fputs($socket,$in); 
    fclose$socket ); 
    ?>

    I am facing a weird problem. This is a POP account creation script. If I run it from my Win2000 PC, it creates the POP account. But when I run this script from the Linux server (CPanel is also on that server), it does not create any POP account.

    Any help will be highly appreciated.

    K Singh

  2. #2
    Member
    Join Date
    Nov 2003
    Location
    Some Where Out There!
    Posts
    87

    Default Re: POP account creation script. Runs fine on Win2000, not on Linux.

    Originally posted by ksingh
    I posted the same matter at WHT. But as I have not been able to get my answer, I am posting it here now.

    PHP Code:
    <? 
    $host 
    "hostname"
    $socket fsockopen($host,2082); 
    socket_set_timeout($socket,30); 

    $cpaneluser "cpanel_username"
    $cpanelpass "cpanel_password"
    $authstr "$cpaneluser:$cpanelpass"

    $domain "domainname"
    $email="desired_username"
    $password="desired_password"
    $quota=10

    $pass base64_encode($authstr); 
    $in "GET /frontend/bluelagoon/mail/doaddpop.html?email=$email&domain=$domain&password=$password&quota=$quota HTTP/1.0\r\nAuthorization: Basic $pass \r\n\r\n"
    print 
    $in

    fputs($socket,$in); 
    fclose$socket ); 
    ?>

    I am facing a weird problem. This is a POP account creation script. If I run it from my Win2000 PC, it creates the POP account. But when I run this script from the Linux server (CPanel is also on that server), it does not create any POP account.

    Any help will be highly appreciated.

    K Singh
    Only thing I can think of is put an @ in front of fsockopen like @fsockopen

    worth a shot.

  3. #3
    Member
    Join Date
    Mar 2003
    Posts
    29

    Default

    No effect. For info sake on Win2000 PHP version is 4.3.1 and on Linux is 4.3.4.

    K Singh

  4. #4
    Member
    Join Date
    Sep 2002
    Posts
    7

    Default Wait for response

    You have to make a while loop which waits until the page has returned all the data.

    The new cpanelmail script works like this it took me a while to figure it out.

    Best Regards,
    Nic Conroy
    http://lucidstorm.com

Similar Threads & Tags
Similar threads

  1. ChkServd reports 'httpd failed' but server runs fine ?!
    By bmett in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 09-28-2011, 08:16 PM
  2. Replies: 7
    Last Post: 07-23-2011, 08:53 PM
  3. addpop runs fine but email isn't created
    By nelwa in forum cPanel Developers
    Replies: 1
    Last Post: 02-16-2010, 12:40 PM
  4. php mail() will not work for user nobody, runs fine as root
    By mraberration in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 01-06-2005, 12:19 PM
  5. php mail() will not work for user nobody, runs fine as root.
    By mraberration in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 01-04-2005, 09:19 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube