|
|
@@ -3,7 +3,6 @@
|
|
|
namespace ThurData\Servers\KerioEmail\Core\Helper;
|
|
|
use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Server;
|
|
|
use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
|
|
|
-use ThurData\Servers\KerioEmail\Core\Helper\ConfigOptionsHelper;
|
|
|
|
|
|
require_once '/usr/share/php/Net/DNS2.php';
|
|
|
use \Net\DNS2\Net_DNS2_Resolver as Net_DNS2_Resolver;
|
|
|
@@ -16,8 +15,6 @@ use \Net\DNS2\Net_DNS2_Resolver as Net_DNS2_Resolver;
|
|
|
class DnsHelper
|
|
|
{
|
|
|
use \ThurData\Servers\KerioEmail\Core\UI\Traits\WhmcsParams;
|
|
|
- const SPF = 'v=spf1 mx a:mail3.seecure.ch ip4:185.163.51.0/24 ip4:89.35.78.0/23 ~all';
|
|
|
- const DMARC = 'v=DMARC1; p=reject; rua=mailto:technik@thurdata.ch; ruf=mailto:technik@thurdata.ch';
|
|
|
public function KerioEmailCheckDNS()
|
|
|
{
|
|
|
unset($zoneID);
|
|
|
@@ -31,19 +28,12 @@ class DnsHelper
|
|
|
$clientDomains = localAPI('GetClientsDomains', array('clientid' => $params['userid']));
|
|
|
$productManager = new ProductManager();
|
|
|
$productManager->loadById($params['pid']);
|
|
|
- $spf = $productManager->get('spf_string');
|
|
|
- $dmarc = $productManager->get('dmarc_string');
|
|
|
-
|
|
|
- logModuleCall(
|
|
|
- 'kerioEmail',
|
|
|
- __FUNCTION__,
|
|
|
- $spf,
|
|
|
- 'Debug',
|
|
|
- $dmarc
|
|
|
- );
|
|
|
-
|
|
|
+ $spfConfig = $productManager->get('spf_string');
|
|
|
+ $dmarcConfig = $productManager->get('dmarc_string');
|
|
|
if($clientDomains['totalresults'] == 0){
|
|
|
$vars['selfDNS'] = FALSE;
|
|
|
+ $vars['dmarc'] = $dmarc;
|
|
|
+ $vars['spf'] = $spf;
|
|
|
return $vars;
|
|
|
}
|
|
|
$resolver = new \Net_DNS2_Resolver(array('nameservers' => $nameserver));
|
|
|
@@ -100,7 +90,7 @@ class DnsHelper
|
|
|
$vars['spf'] = 'unset';
|
|
|
} else {
|
|
|
foreach($domainSPF as $spf) {
|
|
|
- if($spf === SPF) {
|
|
|
+ if($spf === $spfConfig) {
|
|
|
$vars['spf'] = 'set';
|
|
|
}
|
|
|
}
|
|
|
@@ -129,7 +119,7 @@ class DnsHelper
|
|
|
$vars['dmarc'] = 'unset';
|
|
|
} else {
|
|
|
foreach($domainDMARC as $dmarc) {
|
|
|
- if($dmarc === DMARC) {
|
|
|
+ if($dmarc === $dmarcConfig) {
|
|
|
$vars['dmarc'] = 'set';
|
|
|
}
|
|
|
}
|