no quotation of dns data for powerdns
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -292,7 +292,7 @@ function addRequiredEntry($record = '@', $type = 'A', &$required)
|
|||||||
function encloseTXTContent($txt_content, $isMultiLine = false)
|
function encloseTXTContent($txt_content, $isMultiLine = false)
|
||||||
{
|
{
|
||||||
// check that TXT content is enclosed in " "
|
// 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) != '"') {
|
if (substr($txt_content, 0, 1) != '"') {
|
||||||
$txt_content = '"' . $txt_content;
|
$txt_content = '"' . $txt_content;
|
||||||
}
|
}
|
||||||
@@ -300,6 +300,15 @@ function encloseTXTContent($txt_content, $isMultiLine = false)
|
|||||||
$txt_content .= '"';
|
$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;
|
return $txt_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
* @package Functions
|
* @package Functions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function generateDkimEntries($domain)
|
function generateDkimEntries($domain)
|
||||||
{
|
{
|
||||||
$zone_dkim = array();
|
$zone_dkim = array();
|
||||||
@@ -55,12 +54,17 @@ function generateDkimEntries($domain)
|
|||||||
// end-part
|
// end-part
|
||||||
$dkim_txt .= 't=s';
|
$dkim_txt .= 't=s';
|
||||||
|
|
||||||
|
if (Settings::Get('system.dns_server') == 'pdns') {
|
||||||
|
// PowerDNS does not need/want splitted content
|
||||||
|
$txt_record_split = $dkim_txt;
|
||||||
|
} else {
|
||||||
// split if necessary
|
// split if necessary
|
||||||
$txt_record_split = '';
|
$txt_record_split = '';
|
||||||
$lbr = 50;
|
$lbr = 50;
|
||||||
for ($pos = 0; $pos <= strlen($dkim_txt) - 1; $pos += $lbr) {
|
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";
|
$txt_record_split .= (($pos == 0) ? '("' : "\t\t\t\t\t \"") . substr($dkim_txt, $pos, $lbr) . (($pos >= strlen($dkim_txt) - $lbr) ? '")' : '"') . "\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// dkim-entry
|
// dkim-entry
|
||||||
$zone_dkim[] = $txt_record_split;
|
$zone_dkim[] = $txt_record_split;
|
||||||
|
|||||||
Reference in New Issue
Block a user