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 forwarder

Discussion in 'General Discussion' started by AG-Soft, Jul 1, 2004.

  1. AG-Soft

    AG-Soft Member

    Joined:
    Jun 18, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    hi!

    I posted two days ago to ask for help to add an e-mail-forwarder through my php-script. I don't know what happened to the post, but I got some usefull help and I developed the following script. It might be helpfull for some of you.

    PHP:
    <?
    //Variablen
    $CPanelUser "user"//Ihr CPanel User-Name
    $CPanelPass "pass"//Ihr CPanel-Passwort
    $domain "domain"//Ihre Domain
    $email "vordererteil";  //vorderer Teil der E-Mail-Adresse, die angelegt werden soll
    $forward "weiterleitung"//an diese E-Mail-Adresse werden dann die E-Mails weitergeleitet

    //ab hier nichts mehr ändern
    $auth $CPanelUser.":".$CPanelPass;
    $sAuth base64_encode($auth);
    $sHTTP "GET /frontend/x/mail/doaddfwd.html?email=".$email."&domain=".$domain."&forward=".$forward."\r\n HTTP/1.0\r\nAuthorization: Basic $sAuth\r\n";
    $hSocket fsockopen($domain2082);
    fputs($hSocket$sHTTP);
    fclose($hSocket);

    //ENDE

    ?>
    Even the description is in German, you should be able to understand it

    Have fun with it!

    Alexander Göbel
    http://www.ag-hosting.de
     
Loading...

Share This Page