Reply to String parsing bug

Your name:

Reply:


Posted by ooba gooba on 09/11/06 20:28

Hi,

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:

class Bug
{
var $From = 'address@domain.com';

function Test()
{
echo "FROM=[$this->From]<br>";

$returnpath = "Return-path: <$this->From>\n";
echo "1: $returnpath<br>";

$returnpath = "Return-path: <{$this->From}>\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();
$instance->Test();

Results in this output:

FROM=[address@domain.com]
1: Return-path:
2: Return-path:
3: Return-path:
4: Return-path:
5: Return-path: <[address@domain.com]>
6: Return-path: [address@domain.com]

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?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация