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.

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:
    1
    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:
    1
    Trophy Points:
    18
    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
     
Loading...

Share This Page