php.net |  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
Votes:4
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
 [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 "?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 ?

Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 17:01:25 2024 UTC