|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15590 PEAR's send() & special characters
Submitted: 2002-02-17 00:18 UTC Modified: 2002-11-13 01:00 UTC
Avg. Score:4.8 ± 0.4
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: bjorn at swift dot st Assigned:
Status: No Feedback Package: PEAR related
PHP Version: 4.1.1 OS: FreeBSD 4.5-REL
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: bjorn at swift dot st
New email:
PHP Version: OS:


 [2002-02-17 00:18 UTC] bjorn at swift dot 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 "?" (and allows the MTA to do the error handling)
    <?php mail("?", "Test 1", "Using mail()") ?>

.. the following example code (taken from sends an error to the local postmaster account.
    $recipients = '?';
    $headers['From']    = '';
    $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 ?


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Sep 27 08:05:51 2022 UTC