diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 2e03eed937c..82da31bdeca 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -758,13 +758,31 @@ else
$text = '';
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
- $text .= $langs->trans("WarningPHPMail");
+ $text .= $langs->trans("WarningPHPMail"); // To encourage to use SMTPS
}
- //$conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS='1.2.3.4';
- if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
+
+ if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
- $text .= ($text ? '
' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
+ // MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
+ if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
+ {
+ // List of IP show as record to add in SPF if we use the mail method
+ $text .= ($text ? '
' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
+ }
+ } else {
+ if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
+ {
+ // List of IP show as record to add as allowed IP if we use the smtp method
+ $text .= ($text ? '
' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
+ }
+ if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD))
+ {
+ // List of string to add in SPF if we use the smtp method
+ $text .= ($text ? '
' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
+ }
}
+
+
if ($text) print info_admin($text);
}
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 3c351467284..7bea668e091 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -472,6 +472,7 @@ Use3StepsApproval=By default, Purchase Orders need to be created and approved by
UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than...
WarningPHPMail=WARNING: It is often better to setup outgoing emails to use the email server of your provider instead of the default setup. Some email providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted (be careful also of your email provider's sending quota).
If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider.
WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s.
+WarningPHPMailSPF=If the domain name in your sender email address is protected by SPF (ask you email provider), you must include the following IPs in the SPF record of the DNS of your domain: %s.
ClickToShowDescription=Click to show description
DependsOn=This module needs the module(s)
RequiredBy=This module is required by module(s)