merged with dkim

This commit is contained in:
2016-12-16 17:20:39 +01:00
2 changed files with 59 additions and 45 deletions

View File

@@ -233,7 +233,20 @@ function createDomainZone($domain_id, $froxlorhostname = false, $isMainButSubTo
if (Settings::Get('dkim.use_dkim') == '1') {
$dkim_entries = generateDkimEntries($domain);
}
if ($domain['isemaildomain'] == '1') {
#DKIM AND DMARC
$zonerecords[] = new DnsEntry('mx._domainkey', 'TXT', '("v=DKIM1; k=rsa;"
"p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyk6+Y5RkqqGeTxWmULWE"
"6Z+6SA9M/ccJW9cVhjKLbrGOc3/i0lTvIY1KqNGxvcqZEFyVJJsXL6dnWIcmYY01"
"GIeVL0nAxjLenW3NKFn+bpTmIiHYEegti4R5Il5NRm8o9g41pYqf3yVfqHKr8zNj"
"LnnxBySTX2HpBgTtIZmK13IIbdeeE02aJi5g9AjxpkDak6iv8/kIOVaIgvFKSrSJ"
"E6XZs2ap+RxYLxhDegIwevEFIUUqKYKxwFBx1ELRbvRkxZknH3PdWE9IJqGRxi02"
"gvGhqjXP3JykumRBC47OHeufAeNsx5xy6tsetTq1rOPvMOCeBq1hQWKNUowTMP+/"
"CQIDAQAB"
)');
$zonerecords[] = new DnsEntry('_dmarc', 'TXT', encloseTXTContent('v=DMARC1; p=reject; rua=mailto:nyvpxtul@ag.dmarcian-eu.com; fo=1; adkim=r; aspf=r; pct=100; rf=afrf; ri=86400;'));
}
foreach ($required_entries as $type => $records) {
if ($type == 'TXT') {
foreach ($records as $record) {

View File

@@ -114,28 +114,29 @@ class bind extends DnsBase
$bindconf_file .= ' type master;' . "\n";
$bindconf_file .= ' file "' . makeCorrectFile(Settings::Get('system.bindconf_directory') . '/' . $domain['zonefile']) . '";' . "\n";
$bindconf_file .= ' allow-query { any; };' . "\n";
if (count($this->_ns) > 0 || count($this->_axfr) > 0) {
// open allow-transfer
$bindconf_file .= ' allow-transfer {' . "\n";
// put nameservers in allow-transfer
if (count($this->_ns) > 0) {
foreach ($this->_ns as $ns) {
foreach ($ns["ips"] as $ip) {
$bindconf_file .= ' ' . $ip . ";\n";
}
}
}
// AXFR server #100
if (count($this->_axfr) > 0) {
foreach ($this->_axfr as $axfrserver) {
$bindconf_file .= ' ' . $axfrserver . ';' . "\n";
}
}
// close allow-transfer
$bindconf_file .= ' };' . "\n";
}
# 2016-12-15 disabled now
#if (count($this->_ns) > 0 || count($this->_axfr) > 0) {
# // open allow-transfer
# $bindconf_file .= ' allow-transfer {' . "\n";
# // put nameservers in allow-transfer
# if (count($this->_ns) > 0) {
# foreach ($this->_ns as $ns) {
# foreach ($ns["ips"] as $ip) {
# $bindconf_file .= ' ' . $ip . ";\n";
# }
# }
# }
# // AXFR server #100
# if (count($this->_axfr) > 0) {
# foreach ($this->_axfr as $axfrserver) {
# if (validate_ip($axfrserver, true) !== false) {
# $bindconf_file .= ' ' . $axfrserver . ';' . "\n";
# }
# }
# }
# // close allow-transfer
# $bindconf_file .= ' };' . "\n";
#}
$bindconf_file .= '};' . "\n";
$bindconf_file .= "\n";