Better log table, some MySQL to Redis migrations, API changes, other minor changes...

This commit is contained in:
andryyy
2017-05-08 15:41:05 +02:00
parent 2e6fdba2b6
commit f77c40a179
7 changed files with 122 additions and 110 deletions

View File

@@ -79,17 +79,24 @@ function get_spf_allowed_hosts($domain)
return $hosts;
}
function get_mx_hosts($domain)
{
$hosts = array();
$mx_records = dns_get_record($domain, DNS_MX);
foreach ($mx_records as $mx_record)
{
$new_hosts = get_a_hosts($mx_record['target']);
$hosts = array_unique(array_merge($hosts,$new_hosts), SORT_REGULAR);
}
try {
$mx_records = dns_get_record($domain, DNS_MX);
foreach ($mx_records as $mx_record)
{
$new_hosts = get_a_hosts($mx_record['target']);
$hosts = array_unique(array_merge($hosts,$new_hosts), SORT_REGULAR);
}
}
catch (Exception $e) {
if ($e->getMessage() !== 'dns_get_record(): A temporary server error occurred.') {
throw $e;
}
$mx_records = false;
}
return $hosts;
}