From 36a09aef35aabe132e3063cc66f23fe7f1c9936a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 23 Sep 2009 17:48:43 +0000 Subject: [PATCH] Fix: add Return-Path for simplemail class for used the "error" mail or "form" mail to avoid feedback at www-data --- htdocs/includes/simplemail/class.mail.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/includes/simplemail/class.mail.php b/htdocs/includes/simplemail/class.mail.php index a5c7bb60342..6b430a0e784 100644 --- a/htdocs/includes/simplemail/class.mail.php +++ b/htdocs/includes/simplemail/class.mail.php @@ -339,8 +339,17 @@ class simplemail { } foreach ($this->recipientlist as $key => $to) { + $bounce = ''; + if ($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F) + { + // DOLCHANGE LDR + // 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 = $this->returnpath != '' ? "-f {$this->returnpath}" : ""; + } // $this->recipient = $to['mail']; DOLCHANGE LDR Fix the To in header was not filled - if ( mail($to['mail'], $this->subject, $this->body, $this->makeheader() ) ) { + if ( mail($to['mail'], $this->subject, $this->body, $this->makeheader() , $bounce ) ) { $this->error_log("envoie vers {$to['nameplusmail']} reussi"); } else { $this->error_log("envoie vers {$to['nameplusmail']} echoue");