1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Getting a list of all email accounts via RPC API

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by rootusertom, Jun 15, 2012.

  1. rootusertom

    rootusertom Guest

    0
     
    I need a solution to get a list of ALL email accounts on a Plesk Server via the RPC API.
    Why is it not possible to request multiple email accounts like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <packet version="1.6.3.4">
    <mail>
    <get_info>
    <filter>
    <site-id>1</site-id>
    <site-id>3</site-id>
    <site-id>6</site-id>
    </filter>
    <mailbox/>
    </get_info>
    </mail>
    </packet>


    It WOULD be possible to give multiple account names with the <name> tag, but that does not make sense, because I do not have the account names unless I request the email accounts of a certain site-id.

    If i request the email accounts of all domains each at a time, it will take bloody ages.
    Any hints or solutions?

    regards, Tom
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,547
    Likes Received:
    1,240
    Location:
    Novosibirsk, Russia
    Why you use site-id but not domain_id? What about something like:

    <?xml version="1.0" encoding="UTF-8"?>
    <packet version="1.6.0.2">
    <mail>
    <get_info>
    <filter>
    <domain_id>1</domain_id>
    </filter>
    <cp_access/>
    <mailbox/>
    <aliases/>
    <permissions/>
    </get_info>
    </mail>
    </packet>
     
  3. rootusertom

    rootusertom Guest

    0
     
    LOL, this is a good one.

    I don't use it because:
    1) it is not in the manual
    2) it does not work:
    with
    <?xml version="1.0" encoding="UTF-8"?>
    <packet version="1.6.3.4">
    <mail>
    <get_info>
    <filter>
    <domain-id>1</domain-id>
    </filter>
    <mailbox/>
    </get_info>
    </mail>
    </packet>


    I get the following answer:
    (1014) Parser error: Request is invalid. Error in line 6: Element 'domain-id': This element is not expected. Expected is ( site-id ).

    Your turn.
     
Loading...