Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Mar 2008
    Posts
    20

    Default parking a domain and creating e-mail domain forwarder at the same time?

    dear whm users,

    i am trying to get whm to park a domain and add a domain email forward at the same time. but this can be done in a very difficult way (parking a domain at whm, loggin into cpanel, adding the domain email forwarder). sadly the api has no trigger after parking a domain.

    i wonder if anybody has a clue how to do this in an easier way.

    thanks in advice,
    frkandris
    --

  2. #2
    Member
    Join Date
    Mar 2008
    Posts
    20

    Smile

    up i still wonder if anybody has an idea about this.

  3. #3
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by frkandris View Post
    dear whm users,

    i am trying to get whm to park a domain and add a domain email forward at the same time. but this can be done in a very difficult way (parking a domain at whm, loggin into cpanel, adding the domain email forwarder). sadly the api has no trigger after parking a domain.

    i wonder if anybody has a clue how to do this in an easier way.

    thanks in advice,
    frkandris
    --
    For a trigger, were you just looking at the hooks in /scripts or were you also looking into using the API2 hooks available at /usr/local/cpanel/hooks (documentation is in the README file in that path)?

  4. #4
    Member
    Join Date
    Mar 2008
    Posts
    20

    Default

    i checked both locations but could not find any hooks called after parking a domain. is there one?

    thanks in advice,
    andris
    --

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by frkandris View Post
    i checked both locations but could not find any hooks called after parking a domain. is there one?

    thanks in advice,
    andris
    --
    You must create one per the documentation in the README file.

  6. #6
    Member
    Join Date
    Mar 2008
    Posts
    20

    Smile help needed

    thanks for the advice. the readme says almost nothing usable about this i am not a beginner in coding, so any little clue (what and where to create) would help.

    thanks in advice,
    andris
    --

  7. #7
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    I think one thing that would make understanding hooks much easier is actually seeing the API2 calls used by the x3 interface. It's very difficult to understand hooks without having a basic knowledge of API2. I did a brief overview of API2 in my Customizing cPanel presentation at last year's conference which you can view at:

    http://www.cpanel.net/docs/seminar07...ing_cPanel.pdf

    You can find the source for the X3 interface in /usr/local/cpanel/base/frontend/x3 - looking at the actual API calls will help you learn what parameters to expect.

    For a sample hook, look at:
    /usr/local/cpanel/hooks/passwd/change_password.example

    The accompanying page for changing passwords in the X3 interface is ...:2082/frontend/x3/passwd/index.html, which is stored in /usr/local/cpanel/base/frontend/x3/passwd/index.html

    This should help shed some insight onto hooks and how they work, especially in conjunction with the actual API2 calls that trigger the hooks.

  8. #8
    Member
    Join Date
    Mar 2008
    Posts
    20

    Smile how to call api2 after hook

    thanks dave, i think now i understand the concept of api2 quite well.

    all i still wonder is how can i call the script with api2 usage in it right after parking a domain. (the WHM park function calls "/scripts/park", which is in the whm binary, so i cannot put anything before/after it.. right?)

    frkandris
    --

  9. #9
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by frkandris View Post
    thanks dave, i think now i understand the concept of api2 quite well.

    all i still wonder is how can i call the script with api2 usage in it right after parking a domain. (the WHM park function calls "/scripts/park", which is in the whm binary, so i cannot put anything before/after it.. right?)

    frkandris
    --
    Let make sure I understand you correctly. You want to call a script every time a domain is parked, after the domain has been parked, correct?

  10. #10
    Member
    Join Date
    Mar 2008
    Posts
    20

    Smile

    Quote Originally Posted by cPanelDavidG View Post
    Let make sure I understand you correctly. You want to call a script every time a domain is parked, after the domain has been parked, correct?
    correct

    frkandris
    --

  11. #11
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by frkandris View Post
    correct

    frkandris
    --
    Currently, this is an API1 call, here's the code from X3 that creates a parked domain:

    HTML Code:
    <cpanel Park="park($FORM{'domain'})">
    You may want to read the README file in /usr/local/cpanel/hooks to learn how to use cPanel Hooks. Also check out the example file it refers to.

    cPanel Hooks are called after an action has been performed by cPanel.

    With all of this information, you should be able to put together your own hook .

  12. #12
    Member
    Join Date
    Mar 2008
    Posts
    20

    Smile

    thank you, it works fine in cpanel.

    meanwhile i realized that the misunderstanding was about cpanel vs whm - i was about to call a hook after the park from whm (which is not possible, as the support says).

    thanks anyway
    andris
    --

Similar Threads & Tags
Similar threads

  1. E-Mail domain forwarder not working
    By jo.madhan in forum E-mail Discussions
    Replies: 6
    Last Post: 06-20-2011, 11:45 PM
  2. Park Domain and add Mail Parking to existing domain
    By hostmedic in forum Feature Requests for cPanel/WHM
    Replies: 1
    Last Post: 06-10-2011, 06:02 AM
  3. Replies: 1
    Last Post: 03-04-2011, 10:07 PM
  4. apache locks when creating a new account or parking a domain
    By weblinxinc in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-21-2009, 12:29 AM
  5. named.conf gets empty when creating account or parking domain
    By NNNils in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 11-09-2005, 01:42 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube