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.

Deleting cPanel email forwarder

Discussion in 'cPanel Developers' started by phizor, Feb 5, 2013.

  1. phizor

    phizor Registered

    Joined:
    Feb 5, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Guys,

    been strugling with this for a while now!

    I'm trying to delete a email forwarder. but went through quite a few forums, but didnt have any luck.

    Here is the latest script I have.

    <?php
    include("includes/xmlapi.php");

    $ip = "localhost";
    $account = "username";
    $passwd ="password";
    $port =2083;
    $email_domain = "domain.com";

    $delforw = "forwarder@domain.com=receiver@another_domain.com";

    $xmlapi = new xmlapi($ip);
    $xmlapi->set_port($port);
    $xmlapi->password_auth($account, $passwd);
    $xmlapi->set_debug(0);

    $result_forward = $xmlapi->api1_query($account, "Email", "delforward", $delforw);
    ?>



    what I did try previously

    Instead of the :

    $delforw = "forwarder@domain.com=receiver@another_domain.com";

    I used :

    $call_f = array(domain=>$email_domain, email=>'forwarder@domain.com', fwdopt=>"fwd", fwdemail=>'receiver@another_domain.com');

    and then replaced the $delforw with $call_f
     
  2. phizor

    phizor Registered

    Joined:
    Feb 5, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    ok

    figured it out

    $delforw mustn't represent : "forwarder@domain.com=receiver@another_domain.com" but array("forwarder@domain.com=receiver@another_domain.com")
     
Loading...

Share This Page