Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Creation/Setup of Email Default in postwwwacct

Discussion in 'cPanel Developers' started by Tyler.S, Sep 28, 2010.

  1. Tyler.S

    Tyler.S Member

    Joined:
    Sep 25, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    51
    Location:
    Ontario Canada
    I was wondering if this was possible at all using the xmlapi? I have done some goolge searching as well as here on the forums but I have had no luck. I have created a script to create a DB, DB User, Create Tables in the DB and input information into the DB and now I need to be able to set the default email address to pipe to a program in postwwwacct.

    Any help would be great.
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You should look at the API2 call Email::addforward. I will let you set a 'pipe to' program.

    Since you're using the xmlapi PHP client class, you should be able to do something like this within your existing script:

    Code:
    // all email send to lildave@dave.com will be piped to my_email_program.sh
    $args = array(
    	'domain'    => 'dave.com',
    	'email'    => 'lildave',
    	'fwdopt'    => 'pipe',
    	'pipefwd'    => '/usr/bin/my_email_program.sh',
    );
    
    $xmlapi->api2_query($user, 'Email', 'addforward', $args);
    
    Regards,
    -David
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice