mail_domain_get_by_domain doesn't get the email.

Discussion in 'Developers' Forum' started by vaio1, Oct 11, 2011.

  1. vaio1

    vaio1 ISPConfig Developer

    Hi guys,

    we are connect our software with ISPConfig but we get some difficulties in order to get the list of the email addess set in the ISPConfig by SOAP.

    After the soap connection we call this method:

    $mails = $client->mail_domain_get_by_domain ( $this->getSession (), "ourdomain.com" );

    ourdomain.com is already set in the ISPConfig panel and work as well but the result of the call is empty. Why?!

    thanks
     
  2. till

    till Super Moderator

    Which ISPConfig version do you use for development? There was a bug in this function in the api in 3.0.3.3. which has been fixed in 3.0.4 beta.
     
  3. vaio1

    vaio1 ISPConfig Developer

    The quotes have been added in you code. The result is the same. Does we have to connect to the mailserver?

    We have the ispconfig 3 multiserver with the configuration
     
  4. till

    till Super Moderator

    Connections are always done to the master server.

    The changes were not about quotes, the changes were in the variable name. The function in 3.0.4 has been tested last week successfully. The function in 3.0.3.3 is broken.
     
  5. vaio1

    vaio1 ISPConfig Developer

    Yes, i forgot to write in the last post that i have changed the domain var from domain_id to domain too.

    Any idea?
     
  6. till

    till Super Moderator

    You can debug the function by returning the sql query that is used to get the domain as soap error and then try this query in the ispconfig database of the master with phpmyadmin to see if it return the correct results.
     
  7. vaio1

    vaio1 ISPConfig Developer

    this is the result in MySQL. The SOAP request is empty.

    Code:
    mysql> SELECT * FROM mail_domain WHERE domain = 'ourdomain.com';
    +-----------+------------+-------------+---------------+----------------+----------------+-----------+-------------------+--------+
    | domain_id | sys_userid | sys_groupid | sys_perm_user | sys_perm_group | sys_perm_other | server_id | domain            | active |
    +-----------+------------+-------------+---------------+----------------+----------------+-----------+-------------------+--------+
    |         3 |          1 |           4 | riud          | ru             |                |         3 | ourdomain.com | y      |
    +-----------+------------+-------------+---------------+----------------+----------------+-----------+-------------------+--------+
    
     
    Last edited: Oct 11, 2011
  8. till

    till Super Moderator

    How did you check if its empty? The functions returns a two dimensional arry, not a one dimensional array. Please use the print_r() function to display the output that you received from the remote script.
     
  9. vaio1

    vaio1 ISPConfig Developer

    I have printed the value using the print_r() function but the result is an bool(false)
     
    Last edited: Oct 11, 2011
  10. till

    till Super Moderator

    Then you might have to try to debug your code, you should also check if you enabled thsi function for the remote user that you use to conect to ispconfig. We had tested this function a few days ago here and it worked, so I'am sure that the code in 3.0.4 is ok.
     
  11. vaio1

    vaio1 ISPConfig Developer

    All the remote methods are enabled and the request of the connection is correct. So why there are no errors/exceptions. strange thing! I'll doublecheck it

    Other question
    Is there a way to get the client_id from the email of the user set in the ISPConfig administration panel? I don't know how to match my users in the billing web software with the ISPConfig software. Any suggestion?

    thanks
     
  12. till

    till Super Moderator

    You mean client id by client email? There is no such function available yet, for a full list of functions, see the new api docs that are part of ispconfig 3.0.4. Users in ispconfig dont have a email address.
     
  13. vaio1

    vaio1 ISPConfig Developer

    No, I mean this one:

    function sites_web_domain_add($session_id, $client_id, $params, $readonly = false)

    furthermore there are no $params description. Have you a manual or something that can help me?

    thanks
     
  14. till

    till Super Moderator

    The client_id is the same in all functions, it is the unique ID that identifies a client and has to be used in all functions. There is a function to get the client_id by sys_userid of a record. All functions are described in detail in the new api docs.

    There is a full params description in the api documentation and also a working example function for each api call. Download the 3.0.4 beta and take a look in the remote_client folder or get the latest svn release.
     
  15. vaio1

    vaio1 ISPConfig Developer

    Where is the api documentation?
     
  16. till

    till Super Moderator

    Have you downloaded 3.0.4 beta and looked at the remoting_client folder as I suggested? There are just two subfolders inside that folder and one is named API-docs and there you find the api docs.
     
  17. vaio1

    vaio1 ISPConfig Developer

    Thanks Till I have found it!

    Which is the mail method to get all the client's email accounts? I don't see it.
     
  18. till

    till Super Moderator

    All functions that are currently available in the remote API are listed in the api docs. If a function is not listed there, then it does not exist.
     
  19. vaio1

    vaio1 ISPConfig Developer

    Ok. So there is no way to show the list of the account email addresses of a particular user starting by your API.
    I mean that there is no way to start from a common field like the username and get all the email accounts in order to show all the accounts in a list.
     
    Last edited: Oct 11, 2011
  20. till

    till Super Moderator

    The API ihas been developed mainly for adding records to ispconfig, e.g. during the order process. If you need additional functions, feel free to extend it.
     

Share This Page