#15590 [Opn->Fbk]: PEAR's send() & special characters
| From: | iliaa@php.net | Date: | Mon, 28 Oct 2002 13:16:50 +0000 |
| Subject: | #15590 [Opn->Fbk]: PEAR's send() & special characters | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-10308@lists.php.net to get a copy of this message | ||
ID: 15590
Updated by: iliaa@php.net
Reported By: bjorn@swift.st
-Status: Open
+Status: Feedback
Bug Type: PEAR related
Operating System: FreeBSD 4.5-REL
PHP Version: 4.1.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-04-23 12:38:21] mville@utc.fr
This problem is still present in the 4.1.2 version of PHP/PEAR.
It can be reproduced using IMP 3.0 as MUA and Postfix as MTA.
Postfix users can use this workaround :
you can add the 'reject_non_fqdn_recipient' to the
'smtpd_recipient_restrictions' postfix parameter to reject the badly
RFC822 formed email containing the '<@>' recipient address. Then, the
email client (IMP 3.0) will display an error message.
Additionaly, if you have your MUA (IMP 3.0) and your MTA (postfix) on
the same host, you must configure the following Horde 2.0
parameters(located in the 'config/horde.php' file) :
$conf['mailer']['type'] = 'smtp';
$conf['mailer']['params'] = array('host' => 'localhost');
------------------------------------------------------------------------
[2002-02-17 00:18:50] bjorn@swift.st
When sending mail to an email address including special characters
(i.e. æáó) using PEAR's Mail send(), an error is not returned but an
email sent to the local postmaster account.
While the following command sends an email to "ævar@example.com" (and
allows the MTA to do the error handling)
<?php mail("ævar@example.com", "Test 1", "Using mail()") ?>
.. the following example code (taken from http://pear.php.net)
sends an
error to the local postmaster account.
<?php
include('Mail.php');
$recipients = 'ævar@example.com';
$headers['From'] = 'me@myhost.com';
$headers['To'] = $recipients ;
$headers['Subject'] = 'Test 2';
$body = 'Using PEAR\'s send()';
$params['sendmail_path'] = '/usr/local/sbin/sendmail';
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory('sendmail', $params);
$mail_object->send($recipients, $headers, $body);
?>
I have played a little with the PEAR code and traced the problem to a
regular expression match in Mail/RFC822.php, line 518.
if (!preg_match('/^[\\x00-\\x7E]+$/i', $atom, $matches)) {
return false;
}
I have red *some* of RFC822 and know that ASCII characters above 127
are not allowed (correct ?), but shouldn't PEAR either
a) Return an error
b) Pass the message along to the MTA like mail()
.. instead of the message going to the local postmaster without
notifying the sender ?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15590&edit=1