DNS api issues

Discussion in 'Developers' Forum' started by szkhost, Jun 9, 2023.

  1. szkhost

    szkhost New Member

    Greetings,

    Ever since the update to ISPConfig Version: 3.2.10 , DNS api seems to not work.
    It returns an error, about missing ipv6 :

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>dns_wizard_error</faultcode><faultstring>error_ipv6_empty&lt;br /&gt;error_email_regex&lt;br /&gt;</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    error_ipv6_empty<br />error_email_regex<br />09-06-2023 09:30:01 DNS handler script ran, with vhost change detection in file srv.freecp.cf.vhost

    The code is :
    Code:
    function zoneAdd($ispapi, $session_id, $customer_id, $main_domain, $nameserver1, $nameserver2, $vhost_ipv4)
    {
        $template_id = 3;
        $domain = $main_domain;
        $ip = $vhost_ipv4;
        $ns1 = $nameserver1;
        $ns2 = $nameserver2;
        $email = 'srv.hostico.ro';
        $ispapi->dns_templatezone_add($session_id, $customer_id, $template_id, $domain, $ip, $ns1, $ns2, $email);
        //additionally adds domain to Email -> Email Domain
        $params = array(
        'server_id' => 1,
        'domain' => $domain,
        'active' => 'y'
        );
    
    This code worked until I updated.
    Is there a new paramater in the api, where I need to add ipv6 ?
    Thank you!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I'll check that.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

  4. szkhost

    szkhost New Member

    Hello Till,
    Thanks for the support.
    Yes, now it seems to work and the zone gets added via api.
    The api call still returns an errors , about dkim :
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>data_processing_error</faultcode><faultstring>dkim_selector_error&lt;br /&gt;&#13;
    </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
    dkim_selector_error<br />

    But the zone gets added correctly.
     
  5. szkhost

    szkhost New Member

    Oh, sorry, this seems to be returned by mail_domain_add () api which is in the same script I have made.
    It may be another issue.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I'll have a look at that too.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The problem here is that dkim_selector is set by the UI and it should not be empty, but the API did not check this before and that's why it throws an error now as we fixed that issue. But I've implemented a workaround now so that the API sets the parameter on its own in case the API call does not set it in the params array. You can get that file here:

    https://git.ispconfig.org/ispconfig...d/interface/lib/classes/remote.d/mail.inc.php

    copy it to /usr/local/ispconfig/interface/lib/classes/remote.d/
     
    ahrasis likes this.
  8. szkhost

    szkhost New Member

    Yes, now it works. I will try to pass the correct paramaters to the api.
    Is there a way to generate the dkim keys for this domain via api ? Or calling a php script from ispconfig to generate the keys via commandline ?
    Thank you for the help.
     

Share This Page