Commit 2fe08be5 authored by Jan-Erik Revsbech's avatar Jan-Erik Revsbech
Browse files

Fixed bug #292 concerning ReturnPAth in htmlmail class. The fix has two...

Fixed bug #292 concerning ReturnPAth in htmlmail class. The fix has two different solutions one for windows which always work, and one for Linux, which only works when safe_mode is off.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@458 709f56b5-9817-0410-a4d7-c38de5d9e867
parent 656c6580
2004-09-00 Jan-Erik Revsbech <jer@moccompany.com>
* Fixed bug #292 concerning Return path in class.t3lib_mailer.php. The fix has a seperate solution for windows and Unix. The unix fix does however not work with safe_mode enabled. Do not know how to overcome this. Perhaps an environment variable for sendmail can be specified? The fix for windows works OK with safe_mode on since, it does not rely on passing parameter directly to the mailer tranport agent (Sendmail or postfix), but instead sets the php variable sendmail_from, which has no effect on Unix systemt.
2004-09-02 Kasper Skårhøj,,, <kasper@typo3.com>
* Fixed a few basic PHP5 problems (aiming at PHP5 support in 3.7.0)
......
......@@ -604,16 +604,40 @@ class t3lib_htmlmail {
// Requires the recipient, message and headers to be set.
#debug(array($this->recipient,$this->subject,$this->message,$this->headers));
if (trim($this->recipient) && trim($this->message)) { // && trim($this->headers)
mail( $this->recipient,
$returnPath = (strlen($this->returnPath)>0)?"-f".$this->returnPath:'';
//On windows the -f flag is not used (specific for sendmail and postfix), but instead the php.ini parameter sendmail_from is used.
if($this->returnPath) {
ini_set(sendmail_from, $this->returnPath);
}
//If safe mode is on, the fifth parameter to mail is not allowed, so the fix wont work on unix with safe_mode=On
if(!ini_get('safe_mode')) {
mail( $this->recipient,
$this->subject,
$this->message,
$this->headers,
$returnPath);
}
else {
mail( $this->recipient,
$this->subject,
$this->message,
$this->headers );
$this->headers);
}
// Sending copy:
if ($this->recipient_copy) {
if(!ini_get('safe_mode')) {
mail( $this->recipient_copy,
$this->subject,
$this->message,
$this->headers,
$returnPath);
}
else {
mail( $this->recipient_copy,
$this->subject,
$this->message,
$this->headers );
}
}
// Auto response
if ($this->auto_respond_msg) {
......@@ -622,7 +646,11 @@ class t3lib_htmlmail {
mail( $this->from_email,
$theParts[0],
$theParts[1],
"From: ".$this->recipient );
"From: ".$this->recipient,
$returnPath);
}
if($this->returnPath) {
ini_restore(sendmail_from);
}
return true;
} else {return false;}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment