Results 1 to 7 of 7

Thread: Delete forwarder using api

  1. #1
    Member
    Join Date
    Feb 2008
    Posts
    5

    Default Delete forwarder using api

    Anyone know of the api1 or api2 command to delete an email forwarder in cpanel. i can do everything else i need to do with the api i just cant remove forwarders once they are set.

    ps why is there so little documentation on the api? i cant seem to find any at all on api1 commands.

  2. #2
    Member
    Join Date
    Feb 2008
    Posts
    5

    Default

    Anyone? maybe im asking in the wrong place? if a mod reads this can they put this post in the right place.

  3. #3
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,307
    cPanel/WHM Access Level

    Root Administrator

    Default

    Quote Originally Posted by lazzymonk View Post
    Anyone know of the api1 or api2 command to delete an email forwarder in cpanel. i can do everything else i need to do with the api i just cant remove forwarders once they are set.

    ps why is there so little documentation on the api? i cant seem to find any at all on api1 commands.
    When you are deleting a forward in the cPanel interface with the X3 theme, you are executing .../frontend/x3/mail/dodelfwd.html?email=...

    Looking in /usr/local/cpanel/base/frontend/x3/mail/dodelfwd.html yields the API 1 function:

    [HTML]<cpanel Email="delforward($FORM{'email'})">[/HTML]

    Where $FORM{'email'} is the email address.

    Just so you know, improved API documentation is definitely on our to-do lists .

  4. #4
    Member
    Join Date
    Feb 2008
    Posts
    5

    Red face

    Thats great thanx.

    now another thing on the same subject.

    im using urls to interact with the xml api.

    http://domain.com:2082/xml-api/cpanel?user=someone&xmlin=<cpanelaction><module>Email</module><func>delforward</func><apiversion>1</apiversion><args>someone@domain.com=some_else@domain.com</args></cpanelaction>

    that command works, but it does not return anything.

    all i get is

    <cpanelresult>
    <module>Email</module>
    <func>delforward</func>
    <type>event</type>
    <source>internal</source>
    <apiversion>1</apiversion>
    <data>
    <result/>
    </data>
    </cpanelresult>

    which is the same if it works or not. am i missing an arg to get an output or am i using it in a way it was never intended so lucky to get it working at all?

    ps look forward to the better documentation

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,307
    cPanel/WHM Access Level

    Root Administrator

    Default

    Looking at the documentation, it appears where you are going wrong is:

    someone@domain.com=some_else@domain.com

    As far as I can tell, it should just be someone@domain.com (as an email address is the first and apparently only argument passed to this API1 function).

  6. #6
    Member
    Join Date
    Feb 2008
    Posts
    5

    Default

    if i send it someone@domain.com
    it doesnt delete the forwarder and doesnt give a different response either.

    someone@domain.com=some_else@domain.com

    is the only way i can get it to delete the forwarder.

    im confused. i think i might just have to put up with no real response and find anothre way to verify the forwarder was deleted.

    thanx for your help
    Last edited by lazzymonk; 02-04-2008 at 03:01 PM.

  7. #7
    Member
    Join Date
    Jun 2005
    Posts
    119

    Default

    Hi lazzymonk, If you were able to resolve this issue., I would like to know.

Similar Threads

  1. Delete forwarder for non-existent domain
    By paulkoan in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 12-08-2010, 04:50 PM
  2. Delete Email Forwarder
    By TomHudspeth in forum New User Questions
    Replies: 5
    Last Post: 07-29-2010, 05:26 AM
  3. Deleting an email forwarder API issues
    By seengee in forum cPanel Developers
    Replies: 2
    Last Post: 05-14-2010, 06:24 AM
  4. Can't delete forwarder?
    By doni49 in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 03-01-2007, 01:10 PM
  5. Delete forwarder using PHP
    By WoodyUK in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 01-12-2005, 03:33 AM