diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index c9d5ac88812..c0b1d6f2b30 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -20,7 +20,7 @@
/**
* \file htdocs/admin/mails.php
* \brief Page to setup emails sending
- * \version $Id: mails.php,v 1.73 2011/07/10 20:03:39 eldy Exp $
+ * \version $Id: mails.php,v 1.74 2011/07/20 13:01:04 eldy Exp $
*/
require("../main.inc.php");
@@ -592,8 +592,18 @@ else
print '';
- // Boutons actions
+ if ($linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
+ {
+ $sendmailoption=ini_get('mail.force_extra_parameters');
+ //print 'x'.$sendmailoption;
+ if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption))
+ {
+ print '
'.info_admin($langs->trans("SendmailOptionNotComplete"));
+ }
+ }
+
+ // Boutons actions
print '
';
print '
'.$langs->trans("Modify").'';
@@ -737,5 +747,5 @@ else
$db->close();
-llxFooter('$Date: 2011/07/10 20:03:39 $ - $Revision: 1.73 $');
+llxFooter('$Date: 2011/07/20 13:01:04 $ - $Revision: 1.74 $');
?>
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 022964d5cc7..4c319a88739 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -843,6 +843,8 @@ MAIN_PROXY_USER=Login to use the proxy server
MAIN_PROXY_PASS=Password to use the proxy server
DefineHereComplementaryAttributes=Define here all atributes, not already available by default, and that you want to be supported for %s.
ExtraFields=Complementary attributes
+SendingMailSetup=Setup of sendings by email
+SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must conatins option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba).
##### Module password generation
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase.
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index f33e1660176..df3a3521b84 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -856,6 +856,7 @@ MAIN_PROXY_PASS=Mot de passe pour passer le serveur proxy mandataire
DefineHereComplementaryAttributes=Definissez ici la liste des attributs supplémentaire, non disponible en standard, et que vous voulez voir gérez sur les %s.
ExtraFields=Attributs suplémentaires
SendingMailSetup=Configuration de l'envoi par mail
+SendmailOptionNotComplete=Attention, sur certains systèmes Linux, avec cette méthode d'envoi, pour pouvoir envoyer des mails en votre nom, la configuration d'exécution de sendmail doit contenir l'option
-ba (paramètre
mail.force_extra_parameters dans le fichier
php.ini). Si certains de vos destinataires ne reçoivent pas de message, essayer de modifer ce paramètre PHP avec
mail.force_extra_parameters = -ba.
##### Module password generation= undefined
PasswordGenerationStandard= Renvoie un mot de passe généré selon algorithme interne Dolibarr: 8 caractères, chiffres et caractères en minuscules mélangés.
diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php
index 1184ad3fd07..8dda1a9d93b 100644
--- a/htdocs/lib/CMailFile.class.php
+++ b/htdocs/lib/CMailFile.class.php
@@ -25,7 +25,7 @@
/**
* \file htdocs/lib/CMailFile.class.php
* \brief File of class to send emails (with attachments or not)
- * \version $Id: CMailFile.class.php,v 1.146 2011/07/20 11:07:12 eldy Exp $
+ * \version $Id: CMailFile.class.php,v 1.147 2011/07/20 13:01:03 eldy Exp $
* \author Dan Potter.
* \author Eric Seigne
* \author Laurent Destailleur.
@@ -340,13 +340,17 @@ class CMailFile
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'), LOG_DEBUG);
$bounce = ''; // By default
- if ($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F)
+ if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F))
{
// le return-path dans les header ne fonctionne pas avec tous les MTA
// Le passage par -f est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie.
// La variable definie pose des pb avec certains sendmail securisee (option -f refusee car dangereuse)
- $bounce = (! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $conf->global->MAIN_MAIL_ERRORS_TO : ($this->addr_from != '' ? '-f' . $this->addr_from : '') );
+ $bounce .= ($bounce?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $conf->global->MAIN_MAIL_ERRORS_TO : ($this->addr_from != '' ? '-f' . $this->addr_from : '') );
}
+ if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender
+ {
+ $bounce .= ($bounce?' ':'').'-ba';
+ }
$this->message=stripslashes($this->message);