Răsfoiți Sursa

spf configoption

andre 6 luni în urmă
părinte
comite
8dc53c1d34
1 a modificat fișierele cu 6 adăugiri și 16 ștergeri
  1. 6 16
      core/Helper/DnsHelper.php

+ 6 - 16
core/Helper/DnsHelper.php

@@ -3,7 +3,6 @@
 namespace ThurData\Servers\KerioEmail\Core\Helper;
 namespace ThurData\Servers\KerioEmail\Core\Helper;
 use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Server;
 use ThurData\Servers\KerioEmail\Core\Models\Whmcs\Server;
 use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
 use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
-use ThurData\Servers\KerioEmail\Core\Helper\ConfigOptionsHelper;
 
 
 require_once '/usr/share/php/Net/DNS2.php';
 require_once '/usr/share/php/Net/DNS2.php';
 use \Net\DNS2\Net_DNS2_Resolver as Net_DNS2_Resolver;
 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
 class DnsHelper
 {
 {
     use \ThurData\Servers\KerioEmail\Core\UI\Traits\WhmcsParams;
     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()
     public function KerioEmailCheckDNS()
     {
     {
         unset($zoneID);
         unset($zoneID);
@@ -31,19 +28,12 @@ class DnsHelper
         $clientDomains = localAPI('GetClientsDomains', array('clientid' => $params['userid']));
         $clientDomains = localAPI('GetClientsDomains', array('clientid' => $params['userid']));
         $productManager = new ProductManager();
         $productManager = new ProductManager();
         $productManager->loadById($params['pid']);
         $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){
         if($clientDomains['totalresults'] == 0){
             $vars['selfDNS'] = FALSE;
             $vars['selfDNS'] = FALSE;
+            $vars['dmarc'] = $dmarc;
+            $vars['spf'] = $spf;
             return $vars;
             return $vars;
         }
         }
         $resolver = new \Net_DNS2_Resolver(array('nameservers' => $nameserver));
         $resolver = new \Net_DNS2_Resolver(array('nameservers' => $nameserver));
@@ -100,7 +90,7 @@ class DnsHelper
             $vars['spf'] = 'unset';
             $vars['spf'] = 'unset';
         } else {        
         } else {        
             foreach($domainSPF as $spf) {
             foreach($domainSPF as $spf) {
-                if($spf === SPF) {
+                if($spf === $spfConfig) {
                     $vars['spf'] = 'set';
                     $vars['spf'] = 'set';
                 }
                 }
             }
             }
@@ -129,7 +119,7 @@ class DnsHelper
             $vars['dmarc'] = 'unset';
             $vars['dmarc'] = 'unset';
         } else {        
         } else {        
             foreach($domainDMARC as $dmarc) {
             foreach($domainDMARC as $dmarc) {
-                if($dmarc === DMARC) {
+                if($dmarc === $dmarcConfig) {
                     $vars['dmarc'] = 'set';
                     $vars['dmarc'] = 'set';
                 }
                 }
             }
             }