forked from Wavyzz/dolibarr
display spf info from dns
This commit is contained in:
@@ -848,8 +848,19 @@ if ($action == 'edit') {
|
||||
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL');
|
||||
$dnsinfo = false;
|
||||
if (!empty($companyemail)) {
|
||||
$domain = array_pop(explode('@', $companyemail));
|
||||
$dnsinfo = dns_get_record($domain, DNS_TXT);
|
||||
}
|
||||
if (!empty($dnsinfo) && is_array($dnsinfo)) {
|
||||
foreach ($dnsinfo as $info) {
|
||||
if (strpos($info['txt'], 'v=spf1') !== false) {
|
||||
$text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $info['txt']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($text) {
|
||||
print info_admin($text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user