Use Redis for forwarded_hosts, some fixes

This commit is contained in:
andryyy
2017-05-08 23:09:40 +02:00
parent d64ed65575
commit 74359f6df4
6 changed files with 95 additions and 74 deletions

View File

@@ -1,4 +1,6 @@
<?php
error_reporting(0);
function get_spf_allowed_hosts($domain)
{
$hosts = array();
@@ -85,10 +87,11 @@ function get_mx_hosts($domain)
$hosts = array();
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);
if ($mx_records) {
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) {