ZF-10503: Zend_Mail::_filterName does not filter ':'

Description

Hello,

When an email is sent, ':' character is not allowed in the sender name as it is to represent a group (rfc2822).

this code:


$this->_mail = new Zend_Mail('UTF-8');
$this->_mail->setFrom("john.doe@orange.fr", "John:Doe");

will produce this header:

bq.From: John:Doe john.doe@orange.fr

And it is not correct.

I suggest to disallow ':' in _filterName


--- ZendFramework-1.10.8/library/Zend/Mail.php  2010-01-31 10:06:00.000000000 +0100
+++ ZendFramework-work/library/Zend/Mail.php    2010-09-29 17:31:07.556677100 +0200
@@ -1211,6 +1211,7 @@
         $rule = array("\r" => '',
                       "\n" => '',
                       "\t" => '',
+                     ':'  => '',
                       '"'  => "'",
                       '<'  => '[',
                       '>'  => ']',

I got some really weird results without that patch when an user try to have a sender name with ':'. That is my first contribution to ZF and I hope it can help.

Comments

This issue has been resolved in ZF2. Thank you for reporting.