diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 3dcf26fea0a..25d6264bca6 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -1059,18 +1059,20 @@ if ($action == 'edit') {
}
// Test SPF default automatic email from
$defaultnoreplyemail = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
- $dnsinfo = false;
- if (!empty($defaultnoreplyemail) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) {
- $arrayofemailparts = explode('@', $defaultnoreplyemail);
- if (count($arrayofemailparts) == 2) {
- $domain = $arrayofemailparts[1];
- $dnsinfo = dns_get_record($domain, DNS_TXT);
+ if ($defaultnoreplyemail != $companyemail) { // We show if email differs
+ $dnsinfo = false;
+ if (!empty($defaultnoreplyemail) && function_exists('dns_get_record') && !getDolGlobalString('MAIN_DISABLE_DNS_GET_RECORD')) {
+ $arrayofemailparts = explode('@', $defaultnoreplyemail);
+ if (count($arrayofemailparts) == 2) {
+ $domain = $arrayofemailparts[1];
+ $dnsinfo = dns_get_record($domain, DNS_TXT);
+ }
}
- }
- if (!empty($dnsinfo) && is_array($dnsinfo)) {
- foreach ($dnsinfo as $info) {
- if (strpos($info['txt'], 'v=spf') !== false) {
- $text .= ($text ? '
' : '').$langs->trans("ActualMailSPFRecordFound", $defaultnoreplyemail, $info['txt']);
+ if (!empty($dnsinfo) && is_array($dnsinfo)) {
+ foreach ($dnsinfo as $info) {
+ if (strpos($info['txt'], 'v=spf') !== false) {
+ $text .= ($text ? '
' : '').$langs->trans("ActualMailSPFRecordFound", $defaultnoreplyemail, $info['txt']);
+ }
}
}
}