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!

Any way to create a forward programmatically?

Discussion in 'E-mail Discussion' started by Donny Bahama, Dec 8, 2008.

  1. Donny Bahama

    Donny Bahama Registered

    Joined:
    Dec 8, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    My wife and I both need to create email aliases occasionally. I have no problem doing it via cPanel, but it's a bit too much for her. I'd like to create a php page so she can just fill in the alias, click a couple check boxes and submit.

    Is this possible? If so, how?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    To automate the creation of email forwarders, you will need reseller access to the server? Do you have this level of access?

    Alternatively, in 11.24, we are introducing the ability to import forwarders and mail accounts via CSV files and Excel spreadsheets. That is an alternative you may wish to use if your server is on 11.24, or wait for until 11.24 propagates to your server.
     
  3. rrwh

    rrwh Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    156
    I actually worte about this a few weeks ago - see http://forums.cpanel.net/showpost.php?p=448125&postcount=5

    You need root access to the server or a host whom will agree to follow the instructions in the post.

    Once you have the file in a place where you can manipulate it, then it is a simple matter to write yourself a bit of php code to make changes to the file.

    The alternative is that since I have already done it, I might be willing to share for a small consideration.

    Yes, this is one area that is lacking in the API's
     
  4. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,483
    Likes Received:
    31
    Trophy Points:
    158
    cPanel Access Level:
    DataCenter Provider
    You could use the xml-api /cpanel request. See cpanel.net's documentation section for more information,
     
  5. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    168
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Even easier, if you run under suphp, your PHP scripts have direct write access to the forwarders file stored in /etc/valiases/yourdomain.com. You can just open and edit the file directly, though be very careful not to mess up the formatting.
     
    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