Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.0.0

Bug #2242 Error with UTF-8 Headers
Submitted: 2004-08-28 01:01 UTC
From: thomas at haeber dot de Assigned:
Status: No Feedback Package: Mail
PHP Version: 5.0.1 OS: SuSE Linux 9.1 (Kernel 2.6.5)
Roadmaps: (Not assigned)    
Subscription  


 [2004-08-28 01:01 UTC] thomas at haeber dot de
Description: ------------ used Mail 1.1.3 stable UTF-8 headers like: Array ( [MIME-Version] => 1.0 [From] => Bau =?UTF-8?Q?Dr=C3=B6mling?= e.G - Hauptsitz <name@example.de> [To] => name@example.de [Subject] => =?UTF-8?Q?Best=C3=A4tigung?= Ihrer Anfrage bei der Bau =?UTF-8?Q?Dr=C3=B6mling?= e.G. [Content-Type] => text/plain; charset="UTF-8" [Content-Transfer-Encoding] => 8bit ) will abort with the following Error-Message: Fatal error: Cannot use object of type PEAR_Error as array in /usr/local/lib/php/Mail.php on line 136 Reproduce code: --------------- $headers = array( "MIME-Version" => "1.0", "From" => "Bau =?UTF-8?Q?Dr=C3=B6mling?= e.G - Hauptsitz <name@example.de>", "To" => "name@example.de", "Subject" => "=?UTF-8?Q?Best=C3=A4tigung?= Ihrer Anfrage bei der Bau =?UTF-8?Q?Dr=C3=B6mling?= e.G.", "Content-Type" => "text/plain; charset=\"UTF-8\"", "Content-Transfer-Encoding" => "8bit" ); $mail->send("name@example.de", $headers, "some text"); Expected result: ---------------- Actual result: -------------- Fatal error: Cannot use object of type PEAR_Error as array in /usr/local/lib/php/Mail.php on line 136

Comments

 [2004-08-28 01:05 UTC] thomas at haeber dot de
Of course i created a valid mail-object, firsty; e.g.: $mail_params["sendmail_path"] = "path/to/sendmail/"; $mail =& Mail::factory("sendmail", $mail_params);
 [2004-09-09 02:11 UTC] jon
I've fixed the PHP5-specific "Fatal error" in the current CVS code. Now, the code correctly returns a validation failure for the UTF8-encoded address. I don't know enough about UTF8 to understand why the address isn't being validated, however. Help in this area would be appreciated.
 [2004-09-09 02:27 UTC] jon
The address is failing the validateAtom() test in Mail_RFC822. The code appears to be using the correct characters ranges (according to RFC 822), but it must need to do something "special" to recognize UTF8-encoded data.
 [2004-09-10 00:02 UTC] thomas at haeber dot de
After hours, I've found a solution for my Problem. If you use quotemarks for the personal-part of an e-mail the RFC 822-Test will pass. e.g use: "Bau =?UTF-8?Q?Dr=C3=B6mling?= e.G" - Hauptsitz <name@example.de> instead of: Bau =?UTF-8?Q?Dr=C3=B6mling?= e.G - Hauptsitz <name@example.de> By The Way the RFC 822-Test shouldn't fail if you don't use quotemarks. And the Mail-package should send such an Mail. And good work with the resolved fatal error-bug.
 [2004-09-13 05:45 UTC] jon
The quotation marks may be required by the RFC 822 standard, in this case, but I'm not sure. However, your original, unquoted version appears to work fine if you don't require the parseAddressList() method to validate the address for correctness (i.e., don't set the $validate parameter to 'true'). The Mail base class doesn't request validation, so the package *should* be sending your message correct. Perhaps some other error is being encountered? Could you reply with some reproducible code and the text of any PEAR_Error objects that are being returned?
 [2004-12-21 20:18 UTC] chagenbu
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.
 [2005-02-25 11:46 UTC] bugs-horde at interfasys dot ch
I have the same problem with Horde 3.0.3 and IMP 4.0.2. If I have some non-ascii characters in the name of the identity (ie. sàrl which is pretty common since it's gmbh), then the message cannot be sent using UTF-8 encoding. I either have to switch to ISO8859-15 or change the name of the sender.
 [2006-11-20 12:51 UTC] karsten at typo3 dot org (Karsten Dambekalns)
I just stumbled over the same bug - recipient addresses containing special (non-ascii) characters in encoded form are only accepted if all double quotes are stripped from the address... PEAR Mail 1.1.14 PHP 4.3.10