<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=Mail</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/16818" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16432" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15620" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13659" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13587" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12557" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12478" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8818" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/16818">
      <title>Mail: Bug 16818 [Open] Validation Failed Error when entering a dot in FROM Header</title>
      <link>http://pear.php.net/bugs/16818</link>
      <content:encoded><![CDATA[<pre>Mail Bug
Reported by yassineb
2009-11-21T22:16:17+00:00
PHP: 5.2.8 OS: Linux CentOS 5.3 Package Version: 1.2.0b2

Description:
------------
Hello,
I get Validation Failed error when the From Header contains a &quot;dot&quot;:
Validation failed for: FileHost Script V.1.7 


when i remove the &quot;dot&quot; the message get sent:
          $headers = array (
            'MIME-Version' =&gt; '1.0',
            'Content-type' =&gt; 'text/html; charset=iso-8859-1',
            'From' =&gt; str_replace(&quot;.&quot;, &quot;&quot;, $settings['site_title']).&quot; &lt;&quot;.EMAIL_FROM_ADDR.&quot;&gt;&quot;,
            'To' =&gt; $email,
            'Subject' =&gt; $subject);


Thanks.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Bug
Reported by yassineb
2009-11-21T22:16:17+00:00
PHP: 5.2.8 OS: Linux CentOS 5.3 Package Version: 1.2.0b2

Description:
------------
Hello,
I get Validation Failed error when the From Header contains a &quot;dot&quot;:
Validation failed for: FileHost Script V.1.7 


when i remove the &quot;dot&quot; the message get sent:
          $headers = array (
            'MIME-Version' =&gt; '1.0',
            'Content-type' =&gt; 'text/html; charset=iso-8859-1',
            'From' =&gt; str_replace(&quot;.&quot;, &quot;&quot;, $settings['site_title']).&quot; &lt;&quot;.EMAIL_FROM_ADDR.&quot;&gt;&quot;,
            'To' =&gt; $email,
            'Subject' =&gt; $subject);


Thanks.</pre>]]></description>
      <dc:date>2009-11-21T22:55:46+00:00</dc:date>
      <dc:creator>yassinebelc &amp;#x61;&amp;#116; hotmail &amp;#x64;&amp;#111;&amp;#x74; fr</dc:creator>
      <dc:subject>Mail Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16432">
      <title>Mail: Feature/Change Request 16432 [Open] Would you release 1.2.0b2 as a stable, please.</title>
      <link>http://pear.php.net/bugs/16432</link>
      <content:encoded><![CDATA[<pre>Mail Feature/Change Request
Reported by ridera
2009-07-12T21:46:45+00:00
PHP: 5.2.5 OS:  Package Version: 1.2.0b2

Description:
------------
Would you release 1.2.0b2 as a stable, please.

Reason I'm asking is that I use mail() on shared hosts and the providers won't upgrade to betas. Thus, I'm stuck with using the old 1.1.14</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Feature/Change Request
Reported by ridera
2009-07-12T21:46:45+00:00
PHP: 5.2.5 OS:  Package Version: 1.2.0b2

Description:
------------
Would you release 1.2.0b2 as a stable, please.

Reason I'm asking is that I use mail() on shared hosts and the providers won't upgrade to betas. Thus, I'm stuck with using the old 1.1.14</pre>]]></description>
      <dc:date>2009-07-16T00:09:57+00:00</dc:date>
      <dc:creator>alan &amp;#x61;&amp;#116; ridersite &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>Mail Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15620">
      <title>Mail: Documentation Problem 15620 [Open] Please update package license</title>
      <link>http://pear.php.net/bugs/15620</link>
      <content:encoded><![CDATA[<pre>Mail Documentation Problem
Reported by thijs
2009-01-12T15:51:01+00:00
PHP: Irrelevant OS:  Package Version: 1.2.0b1

Description:
------------
Hi,

The package is now licensed under a combination of PHP 2.02 and BSD licenses.

There are some problems with the PHP 2.02 license; for example it states that &quot;This software includes Zend&quot; and &quot;This software includes PHP&quot;, which is not the case for this module.

Would it be possible to update the license? My proposal would be to license all files under the BSD license, so the whole package gets one license, and the BSD license is a widely known liberal open source license. As (in my opinion less preferred) alternative would be to upgrade to version 3.01 of the PHP license.

thanks,
Thijs</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Documentation Problem
Reported by thijs
2009-01-12T15:51:01+00:00
PHP: Irrelevant OS:  Package Version: 1.2.0b1

Description:
------------
Hi,

The package is now licensed under a combination of PHP 2.02 and BSD licenses.

There are some problems with the PHP 2.02 license; for example it states that &quot;This software includes Zend&quot; and &quot;This software includes PHP&quot;, which is not the case for this module.

Would it be possible to update the license? My proposal would be to license all files under the BSD license, so the whole package gets one license, and the BSD license is a widely known liberal open source license. As (in my opinion less preferred) alternative would be to upgrade to version 3.01 of the PHP license.

thanks,
Thijs</pre>]]></description>
      <dc:date>2009-10-14T19:31:37+00:00</dc:date>
      <dc:creator>thijs &amp;#x61;&amp;#116; debian &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>Mail Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13659">
      <title>Mail: Bug 13659 [Verified] Mail parse error in special condition</title>
      <link>http://pear.php.net/bugs/13659</link>
      <content:encoded><![CDATA[<pre>Mail Bug
Reported by mkrivan
2008-04-12T21:42:40+00:00
PHP: 5.2.5 OS: Windows XP Package Version: 1.1.14

Description:
------------
In special circumstances the parsing fail. If some partial text in string is the same, like mailbox name and comment, the parsing will be failed. I also have written a suggestion to solve the problem because I have found the suspicious place in the code.

Thanks for your help.

Test script:
---------------
$address = '&quot;Test Student&quot; &lt;test@mydomain.com&gt; (test)';
$addresses = Mail_RFC822::parseAddressList( $address, 'anydomain.com', TRUE );



Expected result:
----------------
The result should give the parsed email into the following parts:

person: Test Student
mailbox: test
host: mydomain.com
comment: test


Actual result:
--------------
The suspicious code in RFC822.php

            // Catch any RFC822 comments and store them separately.
            $_mailbox = $mailbox;
            while (strlen(trim($_mailbox)) &gt; 0) {
                $parts = explode('(', $_mailbox);
                $before_comment = $this-&gt;_splitCheck($parts, '(');
                if ($before_comment != $_mailbox) {
                    // First char should be a (.
                    $comment    = substr(str_replace($before_comment, '', $_mailbox), 1);
                    $parts      = explode(')', $comment);
                    $comment    = $this-&gt;_splitCheck($parts, ')');
                    $comments[] = $comment;

                    // +1 is for the trailing )
                    $_mailbox   = substr($_mailbox, strpos($_mailbox, $comment)+strlen($comment)+1);
                } else {
                    break;
                }
            }

            foreach ($comments as $comment) {
                $mailbox = str_replace(&quot;($comment)&quot;, '', $mailbox);
            }


I would suggest this:

        // Catch any RFC822 comments and store them separately.
        $p = $q = false;
        do {
          $p = strrpos( $mailbox, '(' ); // last occured
          $q = strpos( $mailbox, ')', $p === false ? 0 : $p );
          if( $p === false || $q === false ) break;
          $comments[] = substr( $mailbox, $p + 1, $q - $p -1 );
          $mailbox = substr( $mailbox, 0, $p ).substr( $mailbox, $q + 1 );
          // delete found comment from mailbox
        } while( true );

        if( $p !== false || $q !== false ) { // there is an error
            $this-&gt;error = 'Invalid address spec. Unmatched quote or bracket ()';
            return false;
        }</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Bug
Reported by mkrivan
2008-04-12T21:42:40+00:00
PHP: 5.2.5 OS: Windows XP Package Version: 1.1.14

Description:
------------
In special circumstances the parsing fail. If some partial text in string is the same, like mailbox name and comment, the parsing will be failed. I also have written a suggestion to solve the problem because I have found the suspicious place in the code.

Thanks for your help.

Test script:
---------------
$address = '&quot;Test Student&quot; &lt;test@mydomain.com&gt; (test)';
$addresses = Mail_RFC822::parseAddressList( $address, 'anydomain.com', TRUE );



Expected result:
----------------
The result should give the parsed email into the following parts:

person: Test Student
mailbox: test
host: mydomain.com
comment: test


Actual result:
--------------
The suspicious code in RFC822.php

            // Catch any RFC822 comments and store them separately.
            $_mailbox = $mailbox;
            while (strlen(trim($_mailbox)) &gt; 0) {
                $parts = explode('(', $_mailbox);
                $before_comment = $this-&gt;_splitCheck($parts, '(');
                if ($before_comment != $_mailbox) {
                    // First char should be a (.
                    $comment    = substr(str_replace($before_comment, '', $_mailbox), 1);
                    $parts      = explode(')', $comment);
                    $comment    = $this-&gt;_splitCheck($parts, ')');
                    $comments[] = $comment;

                    // +1 is for the trailing )
                    $_mailbox   = substr($_mailbox, strpos($_mailbox, $comment)+strlen($comment)+1);
                } else {
                    break;
                }
            }

            foreach ($comments as $comment) {
                $mailbox = str_replace(&quot;($comment)&quot;, '', $mailbox);
            }


I would suggest this:

        // Catch any RFC822 comments and store them separately.
        $p = $q = false;
        do {
          $p = strrpos( $mailbox, '(' ); // last occured
          $q = strpos( $mailbox, ')', $p === false ? 0 : $p );
          if( $p === false || $q === false ) break;
          $comments[] = substr( $mailbox, $p + 1, $q - $p -1 );
          $mailbox = substr( $mailbox, 0, $p ).substr( $mailbox, $q + 1 );
          // delete found comment from mailbox
        } while( true );

        if( $p !== false || $q !== false ) { // there is an error
            $this-&gt;error = 'Invalid address spec. Unmatched quote or bracket ()';
            return false;
        }</pre>]]></description>
      <dc:date>2008-04-17T09:05:27+00:00</dc:date>
      <dc:creator>miklos &amp;#x61;&amp;#116; krivan &amp;#x64;&amp;#111;&amp;#x74; hu</dc:creator>
      <dc:subject>Mail Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13587">
      <title>Mail: Feature/Change Request 13587 [Open] relay params like &quot;NOTIFY=SUCCESS,FAILURE&quot;</title>
      <link>http://pear.php.net/bugs/13587</link>
      <content:encoded><![CDATA[<pre>Mail Feature/Change Request
Reported by alex2000
2008-04-04T06:31:35+00:00
PHP: 5.2.0 OS: SuSe 10.2 Package Version: 1.1.14

Description:
------------
Here:

http://pear.php.net/package/Mail/docs/1.1.14/__filesource/fsource_Mail__Mail-1.1.14Mailsmtp.php.html , line 204 anybody have to place 4th parameter like $params and at the line 282 instead $this-&gt;_smtp-&gt;rcptTo($recipient) have to write $this-&gt;_smtp-&gt;rcptTo($recipient, $params) or somethins like that.

Because I need this optional notify - flags and have to change it each time manually :(

Can anybody do it for the next relase - or maybe another solution /way for the same problem.

Thanks.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Feature/Change Request
Reported by alex2000
2008-04-04T06:31:35+00:00
PHP: 5.2.0 OS: SuSe 10.2 Package Version: 1.1.14

Description:
------------
Here:

http://pear.php.net/package/Mail/docs/1.1.14/__filesource/fsource_Mail__Mail-1.1.14Mailsmtp.php.html , line 204 anybody have to place 4th parameter like $params and at the line 282 instead $this-&gt;_smtp-&gt;rcptTo($recipient) have to write $this-&gt;_smtp-&gt;rcptTo($recipient, $params) or somethins like that.

Because I need this optional notify - flags and have to change it each time manually :(

Can anybody do it for the next relase - or maybe another solution /way for the same problem.

Thanks.</pre>]]></description>
      <dc:date>2008-04-06T02:19:21+00:00</dc:date>
      <dc:creator>positron &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; ch</dc:creator>
      <dc:subject>Mail Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12557">
      <title>Mail: Feature/Change Request 12557 [Open] Use mb_send_mail() if available</title>
      <link>http://pear.php.net/bugs/12557</link>
      <content:encoded><![CDATA[<pre>Mail Feature/Change Request
Reported by derernst
2007-11-30T06:04:50+00:00
PHP: 5.2.2 OS:  Package Version: 1.1.14

Description:
------------
In multilanguage environments working with the mbstring extension is very handy. Anyway, on shared hosting, function overloading is often not available, as mbstring.func_overload   cannot be set at runtime but only at system level. In these cases, the Mail classes use the mail() function, though mb_send_mail() would actually be available. 

I think it would be nice to introduce an option to use mb_send_mail() where it is available.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Feature/Change Request
Reported by derernst
2007-11-30T06:04:50+00:00
PHP: 5.2.2 OS:  Package Version: 1.1.14

Description:
------------
In multilanguage environments working with the mbstring extension is very handy. Anyway, on shared hosting, function overloading is often not available, as mbstring.func_overload   cannot be set at runtime but only at system level. In these cases, the Mail classes use the mail() function, though mb_send_mail() would actually be available. 

I think it would be nice to introduce an option to use mb_send_mail() where it is available.</pre>]]></description>
      <dc:date>2007-11-30T06:04:50+00:00</dc:date>
      <dc:creator>derernst &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; ch</dc:creator>
      <dc:subject>Mail Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12478">
      <title>Mail: Feature/Change Request 12478 [Open] hide PHP warnings, raised from PHP functions used in the class</title>
      <link>http://pear.php.net/bugs/12478</link>
      <content:encoded><![CDATA[<pre>Mail Feature/Change Request
Reported by cwiedmann
2007-11-18T19:48:42+00:00
PHP: Irrelevant OS: Windows_NT Package Version: CVS

Description:
------------
Hello,

Mail_smtp:
For example, if you use mail() on Windows, and the mailserver is down, mail() returns false, and the class returns a PEAR::Error Object. But PHP also outputs a &quot;Warning&quot; with a failure description.

It would be nice, to not see this &quot;Warning&quot;. Instead having the description in PEAR::Error-&gt;getUserInfo() / getDebugInfo().

That's my most important issue. For example in Mail_smtp you also hide the error in popen.

Mail_smtp:
It would be nice, if this class returns only a PEAR::Error and no PHP warning if Net/SMTP.php is not installed. Like it happend, if the Net_SMTP instance can not be created.

Mail_smtpmx:
It would be nice, if this class returns only a PEAR::Error and no PHP warning if Net/DNS is not installed.

Mail_sendmail:
IMHO the default args should be &quot;-t -i&quot;. And not only &quot;-i&quot;.

I have attached a patch, which fix this issues for me.

Regards,
Carsten</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Feature/Change Request
Reported by cwiedmann
2007-11-18T19:48:42+00:00
PHP: Irrelevant OS: Windows_NT Package Version: CVS

Description:
------------
Hello,

Mail_smtp:
For example, if you use mail() on Windows, and the mailserver is down, mail() returns false, and the class returns a PEAR::Error Object. But PHP also outputs a &quot;Warning&quot; with a failure description.

It would be nice, to not see this &quot;Warning&quot;. Instead having the description in PEAR::Error-&gt;getUserInfo() / getDebugInfo().

That's my most important issue. For example in Mail_smtp you also hide the error in popen.

Mail_smtp:
It would be nice, if this class returns only a PEAR::Error and no PHP warning if Net/SMTP.php is not installed. Like it happend, if the Net_SMTP instance can not be created.

Mail_smtpmx:
It would be nice, if this class returns only a PEAR::Error and no PHP warning if Net/DNS is not installed.

Mail_sendmail:
IMHO the default args should be &quot;-t -i&quot;. And not only &quot;-i&quot;.

I have attached a patch, which fix this issues for me.

Regards,
Carsten</pre>]]></description>
      <dc:date>2007-11-18T19:48:42+00:00</dc:date>
      <dc:creator>carsten_sttgt &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>Mail Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8818">
      <title>Mail: Feature/Change Request 8818 [Open] Request Option to suppress email address validation (allow RFC OK fringe cases)</title>
      <link>http://pear.php.net/bugs/8818</link>
      <content:encoded><![CDATA[<pre>Mail Feature/Change Request
Reported by scottprive@...
2006-09-29T17:00:19+00:00
PHP: 5.1.4 OS: Linux Fedora Package Version: 1.1.13

Description:
------------
Requestion an option to completely suppress email address validation. The validation has its uses, but gets in the way of server testing. Two use cases:

1) Server testing (spam relay tests, destructive string tests, etc)

2) Current validation is simple and restrictive, blocking special characters even if they are used in a RFC 3696 valid context:
`domain literals'
&quot;someone@example.com&quot;
possibly others.

I have attempted to disable the raising of RFC822.php errors in Mail.php but have failed (I have begun studying the OO code, but my background is 'function-based' PHP).
 

Test script:
---------------
&lt;?
    require 'Mail.php';
    $to = &quot;\&quot;user name@example.com\&quot;&quot;; #rfc 3696 valid

    $headers['from'] = 'do-not-reply@example.com';
    $headers['subject'] = &quot;email testing &quot;;
    $headers['to'] = $to;
    $headers['Date'] = date('r');


    $params = array(
        &quot;host&quot;      =&gt; 'mail.example.com',
        'port'      =&gt; 25,
        'localhost' =&gt; 'test.example.com',
        'timeout'   =&gt; 240,
        'debug'     =&gt; TRUE,
        'persist'   =&gt; FALSE,
    );


    $body = &quot;
This is a test, which fails on Mail address validtion. &quot;;

    $message =&amp; Mail::factory('smtp',$params);
    $emailresult = $message-&gt;send($to, $headers, $body);
    print &quot;\n RESULT CODE looks like: $emailresult\n&quot;;
    print &quot;\n RESULT OBJECT looks like:&quot;;
    print_r($emailresult);
?&gt;


Expected result:
----------------
The contents of $to become (IN-cluding quotes):
&quot;user name@example.com&quot;

Personally I don't advise or support users with such gray area usernames. The purpose in feeding the RCPT TO with unusual data is to test the target mailserver to see if it is an &quot;open relay&quot;. While the simplest test is to use mailbox@not-your-domain.com, there are another 15-20 testcases using quotes and escaping in an attempt to trick the SMTP server in accepting the email.

Mail.php seems very suited (and more) for such an exercise.



Actual result:
--------------
 RESULT OBJECT looks like:PEAR_Error Object
(
    [error_message_prefix] =&gt;
    [mode] =&gt; 1
    [level] =&gt; 1024
    [code] =&gt;
    [message] =&gt; Validation failed for: &quot;user name@example.com&quot;
    [userinfo] =&gt;
    [backtrace] =&gt; Array
        (
            [0] =&gt; Array
                (
                    [file] =&gt; /usr/share/pear/PEAR.php
                    [line] =&gt; 566
                    [function] =&gt; PEAR_Error
                    [class] =&gt; PEAR_Error
                    [object] =&gt; PEAR_Error Object
 *RECURSION*
                    [type] =&gt; -&gt;
                    [args] =&gt; Array
                        (
                            [0] =&gt; Validation failed for: &quot;user name@example.com&quot;
                            [1] =&gt;
                            [2] =&gt; 1
                            [3] =&gt; 1024
                            [4] =&gt;
                        )

                )

            [1] =&gt; Array
                (
                    [file] =&gt; /usr/share/pear/Mail/RFC822.php
                    [line] =&gt; 198
                    [function] =&gt; raiseError
                    [class] =&gt; PEAR
                    [object] =&gt; Mail_RFC822 Object
                        (
                            [address] =&gt;
                            [default_domain] =&gt; localhost
                            [nestGroups] =&gt;
                            [validate] =&gt; 1
                            [addresses] =&gt; Array
                                (
                                    [0] =&gt; Array
                                        (
                                            [address] =&gt; &quot;user name@example.com&quot;
                                            [group] =&gt;
                                        )

                                )
...</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail Feature/Change Request
Reported by scottprive@...
2006-09-29T17:00:19+00:00
PHP: 5.1.4 OS: Linux Fedora Package Version: 1.1.13

Description:
------------
Requestion an option to completely suppress email address validation. The validation has its uses, but gets in the way of server testing. Two use cases:

1) Server testing (spam relay tests, destructive string tests, etc)

2) Current validation is simple and restrictive, blocking special characters even if they are used in a RFC 3696 valid context:
`domain literals'
&quot;someone@example.com&quot;
possibly others.

I have attempted to disable the raising of RFC822.php errors in Mail.php but have failed (I have begun studying the OO code, but my background is 'function-based' PHP).
 

Test script:
---------------
&lt;?
    require 'Mail.php';
    $to = &quot;\&quot;user name@example.com\&quot;&quot;; #rfc 3696 valid

    $headers['from'] = 'do-not-reply@example.com';
    $headers['subject'] = &quot;email testing &quot;;
    $headers['to'] = $to;
    $headers['Date'] = date('r');


    $params = array(
        &quot;host&quot;      =&gt; 'mail.example.com',
        'port'      =&gt; 25,
        'localhost' =&gt; 'test.example.com',
        'timeout'   =&gt; 240,
        'debug'     =&gt; TRUE,
        'persist'   =&gt; FALSE,
    );


    $body = &quot;
This is a test, which fails on Mail address validtion. &quot;;

    $message =&amp; Mail::factory('smtp',$params);
    $emailresult = $message-&gt;send($to, $headers, $body);
    print &quot;\n RESULT CODE looks like: $emailresult\n&quot;;
    print &quot;\n RESULT OBJECT looks like:&quot;;
    print_r($emailresult);
?&gt;


Expected result:
----------------
The contents of $to become (IN-cluding quotes):
&quot;user name@example.com&quot;

Personally I don't advise or support users with such gray area usernames. The purpose in feeding the RCPT TO with unusual data is to test the target mailserver to see if it is an &quot;open relay&quot;. While the simplest test is to use mailbox@not-your-domain.com, there are another 15-20 testcases using quotes and escaping in an attempt to trick the SMTP server in accepting the email.

Mail.php seems very suited (and more) for such an exercise.



Actual result:
--------------
 RESULT OBJECT looks like:PEAR_Error Object
(
    [error_message_prefix] =&gt;
    [mode] =&gt; 1
    [level] =&gt; 1024
    [code] =&gt;
    [message] =&gt; Validation failed for: &quot;user name@example.com&quot;
    [userinfo] =&gt;
    [backtrace] =&gt; Array
        (
            [0] =&gt; Array
                (
                    [file] =&gt; /usr/share/pear/PEAR.php
                    [line] =&gt; 566
                    [function] =&gt; PEAR_Error
                    [class] =&gt; PEAR_Error
                    [object] =&gt; PEAR_Error Object
 *RECURSION*
                    [type] =&gt; -&gt;
                    [args] =&gt; Array
                        (
                            [0] =&gt; Validation failed for: &quot;user name@example.com&quot;
                            [1] =&gt;
                            [2] =&gt; 1
                            [3] =&gt; 1024
                            [4] =&gt;
                        )

                )

            [1] =&gt; Array
                (
                    [file] =&gt; /usr/share/pear/Mail/RFC822.php
                    [line] =&gt; 198
                    [function] =&gt; raiseError
                    [class] =&gt; PEAR
                    [object] =&gt; Mail_RFC822 Object
                        (
                            [address] =&gt;
                            [default_domain] =&gt; localhost
                            [nestGroups] =&gt;
                            [validate] =&gt; 1
                            [addresses] =&gt; Array
                                (
                                    [0] =&gt; Array
                                        (
                                            [address] =&gt; &quot;user name@example.com&quot;
                                            [group] =&gt;
                                        )

                                )
...</pre>]]></description>
      <dc:date>2006-10-24T16:01:40+00:00</dc:date>
      <dc:creator>scottprive &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
