Bug #15590: PEAR's send() & special characters

From: Date: Sun, 17 Feb 2002 05:18:51 +0000
Subject: Bug #15590: PEAR's send() & special characters
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4754@lists.php.net to get a copy of this message
From: bjorn@swift.st Operating system: FreeBSD 4.5-REL PHP version: 4.1.1 PHP Bug Type: PEAR related Bug description: PEAR's send() & special characters 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 bug report at http://bugs.php.net/?id=15590&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=15590&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=15590&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=15590&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=15590&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=15590&r=support Expected behavior: http://bugs.php.net/fix.php?id=15590&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=15590&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=15590&r=submittedtwice

« previous php.pear.dev (#4754) next »