forked from Wavyzz/dolibarr
Add important warning on sendmail setup to allow to send email from dolibarr.
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/lib/CMailFile.class.php
|
* \file htdocs/lib/CMailFile.class.php
|
||||||
* \brief File of class to send emails (with attachments or not)
|
* \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 Dan Potter.
|
||||||
* \author Eric Seigne
|
* \author Eric Seigne
|
||||||
* \author Laurent Destailleur.
|
* \author Laurent Destailleur.
|
||||||
@@ -340,12 +340,16 @@ class CMailFile
|
|||||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'), LOG_DEBUG);
|
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'), LOG_DEBUG);
|
||||||
|
|
||||||
$bounce = ''; // By default
|
$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 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.
|
// 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)
|
// 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);
|
$this->message=stripslashes($this->message);
|
||||||
|
|||||||
Reference in New Issue
Block a user