Bläddra i källkod

bugfix dns settings

andre 2 år sedan
förälder
incheckning
1dced9a5d9
1 ändrade filer med 12 tillägg och 10 borttagningar
  1. 12 10
      kerioEmail_mx.php

+ 12 - 10
kerioEmail_mx.php

@@ -109,16 +109,9 @@ function KerioEmail_setSPF($params)
     array_push($zoneRecords, $spfRecord);
 
     foreach($dnsZone['data']->records as $record) {
-    
-        logModuleCall(
-            'kerioEmail',
-            __FUNCTION__,
-            $record,
-            'Debug Usage',
-            $record->data
-        );
-        
-        if(!str_starts_with($record->data, 'v=spf')) {
+        if(!$record->type === 'TXT'){
+            array_push($zoneRecords, $record);
+        } elseif (!preg_match("#^v=spf(.*)$#i", $record->data)) {
             array_push($zoneRecords, $record);
         };
     }
@@ -129,6 +122,15 @@ function KerioEmail_setSPF($params)
             'records' => $zoneRecords,
         )
     );
+    
+    logModuleCall(
+        'kerioEmail',
+        __FUNCTION__,
+        $zoneRecords,
+        'Debug Usage',
+        $result
+    );
+    
     if($result['result'] != 'success') {
         return 'Error: cloud not update zone for ID ' . $zoneID;
     }