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!

api2 addforwarder problems

Discussion in 'cPanel Developers' started by kjg, Aug 9, 2011.

Thread Status:
Not open for further replies.
  1. kjg

    kjg Well-Known Member

    Mar 2, 2004
    Likes Received:
    Trophy Points:
    Just want to warn you that the behaviour of
    is not always what you expect

    If you try to add a forwarder with an emailadress not containing @, the forwarder is set to :fail: and all other forwarders for that domain are deleted!
    OK, you should check your input, but to delete all forwarders if there is no @ in fwdemail seems a bit hard
    xmlapi->api2_query("testaccount", "Email", "addforward", array(domain=>'',email=>'test',fwdemail=>'',fwdopt=>'fwd') );

    That call will
    * return nothing
    * set to :fail:
    * delete all other forwarders for

    So check your fwdemail before using this :)

    I did this on purpose to test result codes from the API when using IDN-domains with errors, but was not expecting this behaviour ..

    Also seems that the doc is not up to date for some parts of the API such as Park:: park where setting topdomain will give an error

    But having said this, I must add that I really like the class and use it a lot. It have saved me loads of work.

    // kjg
  2. MattDees

    MattDees Well-Known Member

    Apr 29, 2005
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    When you encounter that problem ,does anything come up in the error_log?
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelRuth

    cPanelRuth Registered
    Staff Member

    Mar 21, 2013
    Likes Received:
    Trophy Points:
    I've run some tests on 11.36, and this is no longer happening at that point. (Disclaimer--I didn't test 11.34 or earlier! YMMV). It's now accepting the "bad" input without deleting other forwards. Now, that said, it's a little murky what precisely would happen if that forward were triggered--but it's not tossing out other records, at least!

    Thanks for the report!

    D Ruth Bavousett
    Integration Developer
    cPanel, Inc.
Thread Status:
Not open for further replies.

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