Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- String parsing bug
- ooba gooba
September 11, 2006, 8:28 pm
rate this thread
I'm trying to track down why some recipients of our emails never receive
them. These emails are sent from a PHP script which uses the 3rd party
phpmailer class. The possible cause for the email problem is that the
email headers have an invalid "Return-path". This is due to an apparent
bug in PHP, which I have replicated as follows:
The following code:
var $From = 'email@example.com';
$returnpath = "Return-path: <$this->From>\n";
echo "1: $returnpath<br>";
$returnpath = "Return-path: <>\n";
echo "2: $returnpath<br>";
$returnpath = 'Return-path: <'.$this->From.">\n";
echo "3: $returnpath<br>";
$returnpath = 'Return-path: '.'<'.$this->From.">\n";
echo "4: $returnpath<br>";
$returnpath = 'Return-path: <['.$this->From."]>\n";
echo "5: $returnpath<br>";
$returnpath = "Return-path: [$this->From]\n";
echo "6: $returnpath<br>";
$instance = new Bug();
Results in this output:
6: Return-path: [firstname.lastname@example.org]
It appears that everything after the < character in the string is
getting truncated. I have so far been unable to generate a valid
Return-path string. My web host is using PHP 4.4.2. I have attached a
sample PHP file that replicates this bug. Does anyone know if this bug
still exists in 4.4.4?
Re: String parsing bug
I highly doubt it.
Browsers usually hide everything in beteween the <>.
Look at the source of the page, and probably all data is there like it
If you're curious what headers are sent, send yourself an email, and check
it's headers. Don't try to emulate them in a browser. Aside from the fact
that a browser has got his own logic you can't trace the path/possible
added headers by either your or another server.