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.

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

Discussion in 'E-mail Discussions' started by frkandris, Apr 23, 2008.

  1. frkandris

    frkandris Member

    Joined:
    Mar 7, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    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. frkandris

    frkandris Member

    Joined:
    Mar 7, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    up:) i still wonder if anybody has an idea about this.
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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. frkandris

    frkandris Member

    Joined:
    Mar 7, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    i checked both locations but could not find any hooks called after parking a domain. is there one?

    thanks in advice,
    andris
    --
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You must create one per the documentation in the README file.
     
  6. frkandris

    frkandris Member

    Joined:
    Mar 7, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    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. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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/Customizing_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. frkandris

    frkandris Member

    Joined:
    Mar 7, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    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. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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. frkandris

    frkandris Member

    Joined:
    Mar 7, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    correct:)

    frkandris
    --
     
  11. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Currently, this is an API1 call, here's the code from X3 that creates a parked domain:

    HTML:
    <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. frkandris

    frkandris Member

    Joined:
    Mar 7, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    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
    --
     
Loading...

Share This Page