Update dns_diagnostics.php

master
Michael Kuron 2018-10-15 20:53:41 +02:00 committed by GitHub
parent 89b0e3e0c6
commit 1bb618d563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 132 additions and 124 deletions

View File

@ -10,9 +10,11 @@ define('state_optional', " <sup>2</sup>");
if (isset($_SESSION['mailcow_cc_role']) && ($_SESSION['mailcow_cc_role'] == "admin"|| $_SESSION['mailcow_cc_role'] == "domainadmin")) {
$domains = mailbox('get', 'domains');
foreach(mailbox('get', 'domains') as $dn) {
$domains = array_merge($domains, mailbox('get', 'alias_domains', $dn));
$alias_domains = array();
foreach($domains as $dn) {
$alias_domains = array_merge($alias_domains, mailbox('get', 'alias_domains', $dn));
}
$domains = array_merge($domains, $alias_domains);
if (isset($_GET['domain'])) {
if (is_valid_domain_name($_GET['domain'])) {
@ -105,6 +107,7 @@ if ($_SESSION['mailcow_cc_role'] == "admin") {
'TLSA',
generate_tlsa_digest($autodiscover_config['smtp']['server'], 25, 1)
);
if (!in_array($domain, $alias_domains)) {
$records[] = array(
'_'.$https_port.
'._tcp.'.$mailcow_hostname,
@ -154,11 +157,13 @@ if ($_SESSION['mailcow_cc_role'] == "admin") {
generate_tlsa_digest($autodiscover_config['sieve']['server'], $autodiscover_config['sieve']['port'], 1)
);
}
}
$records[] = array(
$domain,
'MX',
$mailcow_hostname
);
if (!in_array($domain, $alias_domains)) {
$records[] = array(
'autodiscover.'.$domain,
'CNAME',
@ -175,6 +180,7 @@ $records[] = array(
'CNAME',
$mailcow_hostname
);
}
$records[] = array(
$domain,
'TXT',
@ -195,6 +201,7 @@ if (!empty($dkim = dkim('details', $domain))) {
$dkim['dkim_txt']
);
}
if (!in_array($domain, $alias_domains)) {
$current_records = dns_get_record('_pop3._tcp.' . $domain, DNS_SRV);
if (count($current_records) == 0 || $current_records[0]['target'] != '') {
if ($autodiscover_config['pop3']['tlsport'] != '110') {
@ -264,6 +271,7 @@ if ($autodiscover_config['sieve']['port'] != '4190') {
$autodiscover_config['sieve']['server'] . ' ' . $autodiscover_config['sieve']['port']
);
}
}
$record_types = array(
'A' => DNS_A,