|
@@ -12,6 +12,7 @@ use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataProviders\Providers
|
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataTable;
|
|
use ThurData\Servers\KerioEmail\Core\UI\Widget\DataTable\DataTable;
|
|
|
use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
use ThurData\Servers\KerioEmail\Api\KerioWhmcs;
|
|
|
use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
|
|
use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
|
|
|
|
|
+use ThurData\Servers\KerioEmail\Core\Helper\DnsHelper;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
*
|
|
*
|
|
@@ -115,6 +116,7 @@ class Settings extends DataTable implements ClientArea
|
|
|
try {
|
|
try {
|
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
$api->login($this->getWhmcsParamByKey('serverhostname'), $this->getWhmcsParamByKey('serverusername'), $this->getWhmcsParamByKey('serverpassword'));
|
|
|
$domains = $api->getDomains(['id','name','aliasList']);
|
|
$domains = $api->getDomains(['id','name','aliasList']);
|
|
|
|
|
+ $dkimSet = $api->getDkimDnsRecord($maildomain);
|
|
|
} catch (KerioApiException $error) {
|
|
} catch (KerioApiException $error) {
|
|
|
logModuleCall(
|
|
logModuleCall(
|
|
|
'kerioEmail',
|
|
'kerioEmail',
|
|
@@ -132,30 +134,32 @@ class Settings extends DataTable implements ClientArea
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $dkimSet = $api->getDkimDnsRecord($maildomain);
|
|
|
|
|
-
|
|
|
|
|
- logModuleCall(
|
|
|
|
|
- 'kerioEmail',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $dkimSet,
|
|
|
|
|
- 'Debug Settings',
|
|
|
|
|
- $maildomain
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ $api->logout();
|
|
|
|
|
|
|
|
|
|
+ // format dkim response
|
|
|
$dkimArray = explode(PHP_EOL,$dkimSet['detail']);
|
|
$dkimArray = explode(PHP_EOL,$dkimSet['detail']);
|
|
|
$dkimValue = explode(":",$dkimArray[1]);
|
|
$dkimValue = explode(":",$dkimArray[1]);
|
|
|
$this->domainKey = ltrim($dkimValue[1]);
|
|
$this->domainKey = ltrim($dkimValue[1]);
|
|
|
$dkimName = explode(":",$dkimArray[0]);
|
|
$dkimName = explode(":",$dkimArray[0]);
|
|
|
$this->dkimName = ltrim($dkimName[1]);
|
|
$this->dkimName = ltrim($dkimName[1]);
|
|
|
|
|
|
|
|
- $api->logout();
|
|
|
|
|
-
|
|
|
|
|
// get settings from product configuration
|
|
// get settings from product configuration
|
|
|
$productManager = new ProductManager();
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadById($this->getWhmcsParamByKey('pid'));
|
|
$productManager->loadById($this->getWhmcsParamByKey('pid'));
|
|
|
$this->spfConfig = $productManager->get('spf_string');
|
|
$this->spfConfig = $productManager->get('spf_string');
|
|
|
$this->dmarcConfig = $productManager->get('dmarc_string');
|
|
$this->dmarcConfig = $productManager->get('dmarc_string');
|
|
|
|
|
|
|
|
|
|
+ $dns = new DnsHelper();
|
|
|
|
|
+ $mx = $dns->getMX($maildomain);
|
|
|
|
|
+
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'kerioEmail',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $mx,
|
|
|
|
|
+ 'Debug Settings',
|
|
|
|
|
+ $maildomain
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* format model to array
|
|
* format model to array
|
|
|
*/
|
|
*/
|