Merge pull request #1899 from mailcow/alias-autodiscover
Hide autodiscover records on DNS page for alias domains
This commit is contained in:
commit
58d0f51242
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user