1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-01-26 05:27:29 +02:00

Update dns_diagnostics.php

Sprintf makes multi-lang easier.
Fix indents
This commit is contained in:
André Peters 2018-01-16 09:33:39 +01:00 committed by GitHub
parent 9aeaab23ab
commit f1f7749b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,111 +73,120 @@ if (!isset($autodiscover_config['sieve'])) {
} }
// Init records array // Init records array
$spf_link = '<a href="http://www.openspf.org/SPF_Record_Syntax" target="_blank">SPF Record Syntax</a><br /><small>'.$lang['diagnostics']['allow'].' '.$ip.'<br />'.$lang['diagnostics']['allow'].' '.$ip6.'</small>'; $spf_link = '<a href="http://www.openspf.org/SPF_Record_Syntax" target="_blank">SPF Record Syntax</a><br />
<small>' . sprintf($lang['diagnostics']['allow'], $ip) . '<br />' . sprintf($lang['diagnostics']['allow'], $ip6) . '</small>';
$dmarc_link = '<a href="http://www.kitterman.com/dmarc/assistant.html" target="_blank">DMARC Assistant</a>'; $dmarc_link = '<a href="http://www.kitterman.com/dmarc/assistant.html" target="_blank">DMARC Assistant</a>';
$records = array(); $records = array();
if($_SESSION['mailcow_cc_role'] == "admin") if ($_SESSION['mailcow_cc_role'] == "admin") {
{ $records[] = array(
$mailcow_hostname,
'A',
$ip
);
$records[] = array(
$ptr,
'PTR',
$mailcow_hostname
);
if (!empty($ip6)) {
$records[] = array( $records[] = array(
$mailcow_hostname, $mailcow_hostname,
'A', 'AAAA',
$ip $ip6
); );
$records[] = array( $records[] = array(
$ptr, $ptr6,
'PTR', 'PTR',
$mailcow_hostname $mailcow_hostname
); );
if (!empty($ip6)) { }
$records[] = array( $records[] = array(
$mailcow_hostname, '_25._tcp.'.$autodiscover_config['smtp']['server'],
'AAAA', 'TLSA',
$ip6 generate_tlsa_digest($autodiscover_config['smtp']['server'], 25, 1)
); );
$records[] = array( $records[] = array(
$ptr6, '_'.$https_port.
'PTR', '._tcp.'.$mailcow_hostname,
$mailcow_hostname 'TLSA',
); generate_tlsa_digest($mailcow_hostname, $https_port)
} );
$records[] = array( $records[] = array(
'_25._tcp.' . $autodiscover_config['smtp']['server'], '_'.$autodiscover_config['pop3']['tlsport'].
'TLSA', '._tcp.'.$autodiscover_config['pop3']['server'],
generate_tlsa_digest($autodiscover_config['smtp']['server'], 25, 1) 'TLSA',
); generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['tlsport'], 1)
$records[] = array( );
'_' . $https_port . '._tcp.' . $mailcow_hostname, $records[] = array(
'TLSA', '_'.$autodiscover_config['imap']['tlsport'].
generate_tlsa_digest($mailcow_hostname, $https_port) '._tcp.'.$autodiscover_config['imap']['server'],
); 'TLSA',
$records[] = array( generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['tlsport'], 1)
'_' . $autodiscover_config['pop3']['tlsport'] . '._tcp.' . $autodiscover_config['pop3']['server'], );
'TLSA', $records[] = array(
generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['tlsport'], 1) '_'.$autodiscover_config['smtp']['port'].
); '._tcp.'.$autodiscover_config['smtp']['server'],
$records[] = array( 'TLSA',
'_' . $autodiscover_config['imap']['tlsport'] . '._tcp.' . $autodiscover_config['imap']['server'], generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['port'])
'TLSA', );
generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['tlsport'], 1) $records[] = array(
); '_'.$autodiscover_config['smtp']['tlsport'].
$records[] = array( '._tcp.'.$autodiscover_config['smtp']['server'],
'_' . $autodiscover_config['smtp']['port'] . '._tcp.' . $autodiscover_config['smtp']['server'], 'TLSA',
'TLSA', generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['tlsport'], 1)
generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['port']) );
); $records[] = array(
$records[] = array( '_'.$autodiscover_config['imap']['port'].
'_' . $autodiscover_config['smtp']['tlsport'] . '._tcp.' . $autodiscover_config['smtp']['server'], '._tcp.'.$autodiscover_config['imap']['server'],
'TLSA', 'TLSA',
generate_tlsa_digest($autodiscover_config['smtp']['server'], $autodiscover_config['smtp']['tlsport'], 1) generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['port'])
); );
$records[] = array( $records[] = array(
'_' . $autodiscover_config['imap']['port'] . '._tcp.' . $autodiscover_config['imap']['server'], '_'.$autodiscover_config['pop3']['port'].
'TLSA', '._tcp.'.$autodiscover_config['pop3']['server'],
generate_tlsa_digest($autodiscover_config['imap']['server'], $autodiscover_config['imap']['port']) 'TLSA',
); generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['port'])
$records[] = array( );
'_' . $autodiscover_config['pop3']['port'] . '._tcp.' . $autodiscover_config['pop3']['server'], $records[] = array(
'TLSA', '_'.$autodiscover_config['sieve']['port'].
generate_tlsa_digest($autodiscover_config['pop3']['server'], $autodiscover_config['pop3']['port']) '._tcp.'.$autodiscover_config['sieve']['server'],
); 'TLSA',
$records[] = array( generate_tlsa_digest($autodiscover_config['sieve']['server'], $autodiscover_config['sieve']['port'], 1)
'_' . $autodiscover_config['sieve']['port'] . '._tcp.' . $autodiscover_config['sieve']['server'], );
'TLSA',
generate_tlsa_digest($autodiscover_config['sieve']['server'], $autodiscover_config['sieve']['port'], 1)
);
} }
$records[] = array( $records[] = array(
$domain, $domain,
'MX', 'MX',
$mailcow_hostname $mailcow_hostname
); );
$records[] = array( $records[] = array(
'autodiscover.' . $domain, 'autodiscover.'.$domain,
'CNAME', 'CNAME',
$mailcow_hostname $mailcow_hostname
); );
$records[] = array( $records[] = array(
'_autodiscover._tcp.' . $domain, '_autodiscover._tcp.'.$domain,
'SRV', 'SRV',
$mailcow_hostname . ' ' . $https_port $mailcow_hostname.
' '.$https_port
); );
$records[] = array( $records[] = array(
'autoconfig.' . $domain, 'autoconfig.'.$domain,
'CNAME', 'CNAME',
$mailcow_hostname $mailcow_hostname
); );
$records[] = array( $records[] = array(
$domain, $domain,
'TXT', 'TXT',
$spf_link, $spf_link,
state_optional state_optional
); );
$records[] = array( $records[] = array(
'_dmarc.' . $domain, '_dmarc.'.$domain,
'TXT', 'TXT',
$dmarc_link, $dmarc_link,
state_optional state_optional
); );
if (!empty($dkim = dkim('details', $domain))) { if (!empty($dkim = dkim('details', $domain))) {