2
0
forked from Wavyzz/dolibarr

display spf info from dns

This commit is contained in:
Frédéric FRANCE
2021-10-31 18:43:11 +01:00
parent be6b1e29ad
commit 8ce70aac5d
2 changed files with 14 additions and 2 deletions

View File

@@ -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);
}