Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    1

    Default Any way to create a forward programmatically?

    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. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by Donny Bahama View Post
    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?
    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. #3
    Member
    Join Date
    Oct 2004
    Posts
    45

    Default

    I actually worte about this a few weeks ago - see http://forums.cpanel.net/showpost.ph...25&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. #4
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    Quote Originally Posted by Donny Bahama View Post
    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?
    You could use the xml-api /cpanel request. See cpanel.net's documentation section for more information,
    -Nick
    cPanel Inc.

    Need support? Submit a request here. Complimentary support is available to all license holders regardless of where you purchased your license.
    Need a complimentary support account? Create one here.

  5. #5
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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.

Similar Threads & Tags
Similar threads

  1. programmatically create a mySQL database
    By cneeds in forum cPanel Developers
    Replies: 4
    Last Post: 09-16-2010, 05:50 PM
  2. Need to create forward for each site member - best way?
    By Ben12 in forum E-mail Discussions
    Replies: 0
    Last Post: 07-03-2010, 10:56 PM
  3. PHP Script generating forwarders programmatically
    By organic in forum cPanel Developers
    Replies: 2
    Last Post: 04-27-2009, 11:12 AM
  4. PHP Script generating forwarders programmatically
    By organic in forum E-mail Discussions
    Replies: 2
    Last Post: 04-27-2009, 11:12 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube