[Web] Fix loop in SPF lookup
parent
6e41fa9fc1
commit
692614f79e
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
error_reporting(0);
|
||||
|
||||
function get_spf_allowed_hosts($domain)
|
||||
function get_spf_allowed_hosts($check_domain)
|
||||
{
|
||||
$hosts = array();
|
||||
|
||||
$records = dns_get_record($domain, DNS_TXT);
|
||||
$records = dns_get_record($check_domain, DNS_TXT);
|
||||
foreach ($records as $record)
|
||||
{
|
||||
$txt = explode(' ', $record['entries'][0]);
|
||||
|
@ -47,7 +47,7 @@ function get_spf_allowed_hosts($domain)
|
|||
}
|
||||
|
||||
$new_hosts = array();
|
||||
if ($mech == 'include') // handle an inclusion
|
||||
if ($mech == 'include' && $check_domain != $domain) // handle an inclusion
|
||||
{
|
||||
$new_hosts = get_spf_allowed_hosts($domain);
|
||||
}
|
||||
|
@ -134,4 +134,4 @@ function get_outgoing_hosts_best_guess($domain)
|
|||
// fall back to the A record to get the host name for this domain
|
||||
return get_a_hosts($domain);
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue