diff --git a/lib/functions/dns/function.createDomainZone.php b/lib/functions/dns/function.createDomainZone.php index f7baed6e..424c6ceb 100644 --- a/lib/functions/dns/function.createDomainZone.php +++ b/lib/functions/dns/function.createDomainZone.php @@ -292,7 +292,7 @@ function addRequiredEntry($record = '@', $type = 'A', &$required) function encloseTXTContent($txt_content, $isMultiLine = false) { // check that TXT content is enclosed in " " - if ($isMultiLine == false) { + if ($isMultiLine == false && Settings::Get('system.dns_server') != 'pdns') { if (substr($txt_content, 0, 1) != '"') { $txt_content = '"' . $txt_content; } @@ -300,6 +300,15 @@ function encloseTXTContent($txt_content, $isMultiLine = false) $txt_content .= '"'; } } + if (Settings::Get('system.dns_server') == 'pdns') { + // no quotation for PowerDNS + if (substr($txt_content, 0, 1) == '"') { + $txt_content = substr($txt_content, 1); + } + if (substr($txt_content, - 1) == '"') { + $txt_content = substr($txt_content, 0, -1); + } + } return $txt_content; } diff --git a/lib/functions/dns/function.generateDkimEntries.php b/lib/functions/dns/function.generateDkimEntries.php index e3d5e95a..622af765 100644 --- a/lib/functions/dns/function.generateDkimEntries.php +++ b/lib/functions/dns/function.generateDkimEntries.php @@ -14,7 +14,6 @@ * @package Functions * */ - function generateDkimEntries($domain) { $zone_dkim = array(); @@ -55,11 +54,16 @@ function generateDkimEntries($domain) // end-part $dkim_txt .= 't=s'; - // split if necessary - $txt_record_split = ''; - $lbr = 50; - for ($pos = 0; $pos <= strlen($dkim_txt) - 1; $pos += $lbr) { - $txt_record_split .= (($pos == 0) ? '("' : "\t\t\t\t\t \"") . substr($dkim_txt, $pos, $lbr) . (($pos >= strlen($dkim_txt) - $lbr) ? '")' : '"') . "\n"; + if (Settings::Get('system.dns_server') == 'pdns') { + // PowerDNS does not need/want splitted content + $txt_record_split = $dkim_txt; + } else { + // split if necessary + $txt_record_split = ''; + $lbr = 50; + for ($pos = 0; $pos <= strlen($dkim_txt) - 1; $pos += $lbr) { + $txt_record_split .= (($pos == 0) ? '("' : "\t\t\t\t\t \"") . substr($dkim_txt, $pos, $lbr) . (($pos >= strlen($dkim_txt) - $lbr) ? '")' : '"') . "\n"; + } } // dkim-entry