Browse Source

getting dkim

andre 6 months ago
parent
commit
5cf06519f5
2 changed files with 25 additions and 1 deletions
  1. 14 0
      api/KerioWhmcs.php
  2. 11 1
      core/Helper/DnsHelper.php

+ 14 - 0
api/KerioWhmcs.php

@@ -728,6 +728,20 @@ class KerioWhmcs extends KerioConnectApi {
 		return $result;
 	}
 	
+	/**
+	 * get domain key.
+	 *
+	 * @param	string	Domain
+	 * @return	array	Result
+	 */
+	function getDkimDnsRecord($domain) {
+		$params = array(
+			'domain' => array($domain),
+		);
+		$result = $this->sendRequest('Domains.getDkimDnsRecord', $params);
+		return $result;
+	}
+	
 	/**
 	 * Get list of IP addresses from a file.
 	 *

+ 11 - 1
core/Helper/DnsHelper.php

@@ -38,9 +38,19 @@ class DnsHelper
                 __FUNCTION__,
                 $this->params,
                 'Error: cannot login to ' . $this->params['kerioServer'],
-                $this->server
+        		$error->getMessage()
             );
         }
+        $dkimSet = $api->getDkimDnsRecord($this->params['domain']);
+
+        logModuleCall(
+            'kerioEmail',
+            __FUNCTION__,
+            $this->params,
+            'Debug',
+            $dkimSet
+        );
+
     }    
     
     public function KerioEmailCheckDNS()