2
0
forked from Wavyzz/dolibarr

Update mails.php

This commit is contained in:
Laurent Destailleur
2021-11-01 02:35:15 +01:00
committed by GitHub
parent 8ce70aac5d
commit 3c69fb0ea3

View File

@@ -850,13 +850,13 @@ if ($action == 'edit') {
}
$companyemail = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL');
$dnsinfo = false;
if (!empty($companyemail)) {
if (!empty($companyemail) && function_exists('dns_get_record')) {
$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) {
if (strpos($info['txt'], 'v=spf') !== false) {
$text .= ($text ? '<br><br>' : '').$langs->trans("ActualMailSPFRecordFound", $info['txt']);
}
}