From 6c8fde377cbd2fcb839d65018197ec6f6d5e9ab5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 10 Oct 2025 22:25:03 +0200 Subject: [PATCH] FIX add possibility to override authoritative dns (#35699) --- htdocs/admin/mails.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 3445a7fb905..66be484047e 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -1074,7 +1074,11 @@ if ($action == 'edit') { if ($dnstype == 'DMARC') { $domain = '_dmarc.'.$domain; } - $dnsinfo = dns_get_record($domain, DNS_TXT); + $authns = (!getDolGlobalString('MAIN_MAIL_OVERRIDE_AUTHORITATIVE_DNS') ? array() : explode(',', getDolGlobalString('MAIN_MAIL_OVERRIDE_AUTHORITATIVE_DNS'))); // eg 8.8.8.8, x.x.x.x + $dnsinfo = @dns_get_record($domain, DNS_TXT, $authns); + if ($dnsinfo === false) { + $text .= ($text ? '
' : '').$langs->trans("WarningDNSServerNotAvailable"); + } } if (!empty($dnsinfo) && is_array($dnsinfo)) { foreach ($dnsinfo as $info) {