<?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_Mime</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/16847" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16846" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16706" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16623" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16539" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16493" />
      <rdf:li rdf:resource="http://pear.php.net/bug/16363" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15888" />
      <rdf:li rdf:resource="http://pear.php.net/bug/15320" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14780" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14597" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14529" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14390" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14232" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13969" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13962" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13641" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13468" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13467" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13444" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13032" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12914" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12716" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12628" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12551" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12466" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12456" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12429" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12411" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12216" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11238" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10884" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10438" />
      <rdf:li rdf:resource="http://pear.php.net/bug/3729" />

     </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/16847">
      <title>Mail_Mime: Bug 16847 [Open] Mail.php not found</title>
      <link>http://pear.php.net/bugs/16847</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by brandonusa
2009-11-29T22:57:04+00:00
PHP: 5.1.6 OS: centOS 5.3 Package Version: 1.5.2

Description:
------------
I have centos 5.3 as my linux server. 
On centOS 5.3 First problem I ran into was the pear package was not up to date and I could only fix it via this command
 pear upgrade --force pear

then I did the pear install command
 pear install Mail_Mime-1.5.2

and after doing so 
I can see that mime.php is located in 
/usr/share/pear/Mail/mime.php

BUT I cannot find Mail.php anywhere in the server.
is Mail.php another library I need? I've googled around, I might have to resort to manual installation.


Actual result:
--------------
PHP Fatal error:  Class 'Mail' not found in /home/....</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by brandonusa
2009-11-29T22:57:04+00:00
PHP: 5.1.6 OS: centOS 5.3 Package Version: 1.5.2

Description:
------------
I have centos 5.3 as my linux server. 
On centOS 5.3 First problem I ran into was the pear package was not up to date and I could only fix it via this command
 pear upgrade --force pear

then I did the pear install command
 pear install Mail_Mime-1.5.2

and after doing so 
I can see that mime.php is located in 
/usr/share/pear/Mail/mime.php

BUT I cannot find Mail.php anywhere in the server.
is Mail.php another library I need? I've googled around, I might have to resort to manual installation.


Actual result:
--------------
PHP Fatal error:  Class 'Mail' not found in /home/....</pre>]]></description>
      <dc:date>2009-11-29T22:57:04+00:00</dc:date>
      <dc:creator>brandonusa &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16846">
      <title>Mail_Mime: Bug 16846 [Open] /e modifier not allowed by suhosin</title>
      <link>http://pear.php.net/bugs/16846</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2009-11-29T10:12:22+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
When suhosin.executor.disable_emodifier option is enabled, use of /e modifier in preg_replace is not allowed. preg_replace_callback method must be used to prevent errors from suhosin.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2009-11-29T10:12:22+00:00
PHP: Irrelevant OS:  Package Version: CVS

Description:
------------
When suhosin.executor.disable_emodifier option is enabled, use of /e modifier in preg_replace is not allowed. preg_replace_callback method must be used to prevent errors from suhosin.</pre>]]></description>
      <dc:date>2009-11-29T10:12:22+00:00</dc:date>
      <dc:creator>alec &amp;#x61;&amp;#116; alec &amp;#x64;&amp;#111;&amp;#x74; pl</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16706">
      <title>Mail_Mime: Bug 16706 [Open] Incorrectly double-quotes RFC 2231-encoded parameter values</title>
      <link>http://pear.php.net/bugs/16706</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by asciiphil
2009-10-16T18:16:01+00:00
PHP: 5.2.5 OS: Debian GNU/Linux Package Version: 1.5.2

Description:
------------
When adding parameter values to MIME attachments (e.g. the &quot;name&quot; parameter for the &quot;Content-Type&quot; MIME header), if Mail_Mime determines that RFC 2231 encoding is necessary, it will still put the value in double quotes, which does not match the RFC 2231 spec.

I'm attaching a patch to mimePart.php that will only put in the quotes if the parameter is a &quot;regular-parameter&quot;, according to RFC 2231's ABNF, and not if it's an &quot;extended-parameter&quot;.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by asciiphil
2009-10-16T18:16:01+00:00
PHP: 5.2.5 OS: Debian GNU/Linux Package Version: 1.5.2

Description:
------------
When adding parameter values to MIME attachments (e.g. the &quot;name&quot; parameter for the &quot;Content-Type&quot; MIME header), if Mail_Mime determines that RFC 2231 encoding is necessary, it will still put the value in double quotes, which does not match the RFC 2231 spec.

I'm attaching a patch to mimePart.php that will only put in the quotes if the parameter is a &quot;regular-parameter&quot;, according to RFC 2231's ABNF, and not if it's an &quot;extended-parameter&quot;.</pre>]]></description>
      <dc:date>2009-10-16T18:16:01+00:00</dc:date>
      <dc:creator>phil_g &amp;#x61;&amp;#116; pobox &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16623">
      <title>Mail_Mime: Bug 16623 [Open] When sending mails with attachments, the same boundaries are used</title>
      <link>http://pear.php.net/bugs/16623</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by markusknaup
2009-09-17T17:09:05+00:00
PHP: 5.2.5 OS: Debian Lenny Package Version: 1.5.2

Description:
------------
I had problems, when attaching a file to an e-mail:
&lt;code&gt;
$mime = new Mail_mime(&quot;\n&quot;);
$mime-&gt;setTXTBody($txtBody);
$mime-&gt;setHTMLBody($htmlBody);

if (is_array($attachments)) {
	foreach($attachments as $attachment) {
		$mime-&gt;addAttachment($attachment[&quot;file&quot;], 
$attachment[&quot;contentType&quot;], $attachment[&quot;name&quot;], 
$attachment[&quot;isFile&quot;], $attachment[&quot;encoding&quot;]);
	}
}

$mailBody = $mime-&gt;get($_build_params);
$mailHeaders = $mime-&gt;headers($mailHeaders);

$mail =&amp; Mail::factory($this-&gt;backend, $this-&gt;backendParams);
		
$mail-&gt;send($this-&gt;recip, $mailHeaders, $mailBody);
&lt;/code&gt;

In this use case the mail was sent, but nearly all webmailers and e-mail 
programs did not show the 
attachment(s). I analysed the source code of the sent e-mails and I saw 
that the same boundaries were used 
for different e-mail parts (here &quot;_d188467fafaf9f24df2e4585a2d76019&quot;):
&lt;code&gt;
To: [E-MAIL-ADDRESS]
Subject: [SUBJECT]
MIME-Version: 1.0
From: [ANOTHER E-MAIL-ADDRESS]
Content-Type: multipart/mixed;
	boundary=&quot;=_d188467fafaf9f24df2e4585a2d76019&quot;
Date: Thu, 17 Sep 2009 17:37:41 +0200 (CEST)

--_d188467fafaf9f24df2e4585a2d76019
Content-Type: multipart/alternative;
	boundary=&quot;=_d188467fafaf9f24df2e4585a2d76019&quot;

--=_d188467fafaf9f24df2e4585a2d76019
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=&quot;utf-8&quot;

[CONTENT]
--=_d188467fafaf9f24df2e4585a2d76019
Content-Transfer-Encoding: base64
Content-Type: text/html; charset=&quot;utf-8&quot;

[CONTENT]
--=_d188467fafaf9f24df2e4585a2d76019--

--=_d188467fafaf9f24df2e4585a2d76019
Content-Transfer-Encoding: base64
Content-Type: application/pdf;
 name=&quot;file.pdf&quot;; 
Content-Disposition: attachment;
 filename=&quot;file.pdf&quot;; 

[CONTENT]
--_d188467fafaf9f24df2e4585a2d76019--
&lt;/code&gt;

So, I wrote a simple (not optimal) workaround, but this should be fixed 
somehow in Mail_mime (if it is a bug):
&lt;code&gt;
$mailBody = $mime-&gt;get($_build_params);
$mailHeaders = $mime-&gt;headers($mailHeaders);

// Workaround, because, if attachments exist the same boundary is used 
for several e-mail parts
if (sizeof($this-&gt;attachments) &gt; 0) {
	preg_match(&quot;/boundary=\&quot;(.[^\&quot;]*)\&quot;/e&quot;, $mailHeaders[&quot;Content-
Type&quot;], $boundary);
	$boundary = $boundary[1];
	$bounderyNew = $bounderyNew;
	$mailHeaders[&quot;Content-Type&quot;] = 
preg_replace('/boundary=&quot;(.[^&quot;]*)&quot;/', 'boundary=&quot;' . $bounderyNew . 
'&quot;', $mailHeaders[&quot;Content-Type&quot;]);
	$mailBody = preg_replace(&quot;/^\-\-&quot; . $boundary . &quot;/s&quot;, &quot;--&quot; . 
$bounderyNew, $mailBody);
	$mailBody = preg_replace(&quot;/&quot; . $boundary . &quot;--$/s&quot;, $bounderyNew 
. &quot;--&quot;, $mailBody);
	$mailBody = preg_replace(&quot;/&quot; . $boundary . &quot;--(\s*)--&quot; . $boundary 
. &quot;/s&quot;, $boundary . &quot;--$1--&quot; . 
$bounderyNew, $mailBody);
}

$mail =&amp; Mail::factory($this-&gt;backend, $this-&gt;backendParams);
&lt;/code&gt;

This changes the boundary of the toplevel e-mail parts.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by markusknaup
2009-09-17T17:09:05+00:00
PHP: 5.2.5 OS: Debian Lenny Package Version: 1.5.2

Description:
------------
I had problems, when attaching a file to an e-mail:
&lt;code&gt;
$mime = new Mail_mime(&quot;\n&quot;);
$mime-&gt;setTXTBody($txtBody);
$mime-&gt;setHTMLBody($htmlBody);

if (is_array($attachments)) {
	foreach($attachments as $attachment) {
		$mime-&gt;addAttachment($attachment[&quot;file&quot;], 
$attachment[&quot;contentType&quot;], $attachment[&quot;name&quot;], 
$attachment[&quot;isFile&quot;], $attachment[&quot;encoding&quot;]);
	}
}

$mailBody = $mime-&gt;get($_build_params);
$mailHeaders = $mime-&gt;headers($mailHeaders);

$mail =&amp; Mail::factory($this-&gt;backend, $this-&gt;backendParams);
		
$mail-&gt;send($this-&gt;recip, $mailHeaders, $mailBody);
&lt;/code&gt;

In this use case the mail was sent, but nearly all webmailers and e-mail 
programs did not show the 
attachment(s). I analysed the source code of the sent e-mails and I saw 
that the same boundaries were used 
for different e-mail parts (here &quot;_d188467fafaf9f24df2e4585a2d76019&quot;):
&lt;code&gt;
To: [E-MAIL-ADDRESS]
Subject: [SUBJECT]
MIME-Version: 1.0
From: [ANOTHER E-MAIL-ADDRESS]
Content-Type: multipart/mixed;
	boundary=&quot;=_d188467fafaf9f24df2e4585a2d76019&quot;
Date: Thu, 17 Sep 2009 17:37:41 +0200 (CEST)

--_d188467fafaf9f24df2e4585a2d76019
Content-Type: multipart/alternative;
	boundary=&quot;=_d188467fafaf9f24df2e4585a2d76019&quot;

--=_d188467fafaf9f24df2e4585a2d76019
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=&quot;utf-8&quot;

[CONTENT]
--=_d188467fafaf9f24df2e4585a2d76019
Content-Transfer-Encoding: base64
Content-Type: text/html; charset=&quot;utf-8&quot;

[CONTENT]
--=_d188467fafaf9f24df2e4585a2d76019--

--=_d188467fafaf9f24df2e4585a2d76019
Content-Transfer-Encoding: base64
Content-Type: application/pdf;
 name=&quot;file.pdf&quot;; 
Content-Disposition: attachment;
 filename=&quot;file.pdf&quot;; 

[CONTENT]
--_d188467fafaf9f24df2e4585a2d76019--
&lt;/code&gt;

So, I wrote a simple (not optimal) workaround, but this should be fixed 
somehow in Mail_mime (if it is a bug):
&lt;code&gt;
$mailBody = $mime-&gt;get($_build_params);
$mailHeaders = $mime-&gt;headers($mailHeaders);

// Workaround, because, if attachments exist the same boundary is used 
for several e-mail parts
if (sizeof($this-&gt;attachments) &gt; 0) {
	preg_match(&quot;/boundary=\&quot;(.[^\&quot;]*)\&quot;/e&quot;, $mailHeaders[&quot;Content-
Type&quot;], $boundary);
	$boundary = $boundary[1];
	$bounderyNew = $bounderyNew;
	$mailHeaders[&quot;Content-Type&quot;] = 
preg_replace('/boundary=&quot;(.[^&quot;]*)&quot;/', 'boundary=&quot;' . $bounderyNew . 
'&quot;', $mailHeaders[&quot;Content-Type&quot;]);
	$mailBody = preg_replace(&quot;/^\-\-&quot; . $boundary . &quot;/s&quot;, &quot;--&quot; . 
$bounderyNew, $mailBody);
	$mailBody = preg_replace(&quot;/&quot; . $boundary . &quot;--$/s&quot;, $bounderyNew 
. &quot;--&quot;, $mailBody);
	$mailBody = preg_replace(&quot;/&quot; . $boundary . &quot;--(\s*)--&quot; . $boundary 
. &quot;/s&quot;, $boundary . &quot;--$1--&quot; . 
$bounderyNew, $mailBody);
}

$mail =&amp; Mail::factory($this-&gt;backend, $this-&gt;backendParams);
&lt;/code&gt;

This changes the boundary of the toplevel e-mail parts.</pre>]]></description>
      <dc:date>2009-09-17T17:36:14+00:00</dc:date>
      <dc:creator>mk &amp;#x61;&amp;#116; digitaleprodukte &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16539">
      <title>Mail_Mime: Bug 16539 [Open] Long headers break mime body display</title>
      <link>http://pear.php.net/bugs/16539</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by skibster
2009-08-19T20:15:09+00:00
PHP: 5.1.2 OS: 10.3.9 Package Version: 1.5.2

Description:
------------
If the To header is set in a mixed message text/html, and the header is 
longer than 998 characters, the email body is displayed as the source 
text instead of as HTML.

According to RFC 2822, there is a method for 'folding' long headers. This 
should be implemented to avoid this issue.

Test script:
---------------
&lt;?php
require('Mail.php');
require('Mail/mime.php');
$smtpRelay = 'smtp.example.com';
$smtpPort = 25;
$crlf = &quot;\r\n&quot;;
$headers['To'] = &quot;jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com&quot;;

$headers['From'] = &quot;jskibbie@schawk.com&quot;;
$headers['Subject'] = &quot;This is the Subject&quot;;
$headers['Reply-To'] = $headers['From'];
$headers['X-Mailer'] = 'PHP 5.x';
$params[&quot;host&quot;] = $smtpRelay;
$params[&quot;port&quot;] = $smtpPort;

$textMsg = &quot;A Low Resolution PDF is ready for review.

Please use this link download a compressed archive of the PDF file:

http://thisisthelink.com&quot;;

$htmlMsg ='
&lt;html&gt;
	&lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=ISO-8859-1&quot;&gt;
    &lt;title&gt;'.$headers['Subject'].'&lt;/title&gt;
    &lt;/head&gt;
	&lt;body&gt;
	&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
	&lt;tr&gt;
	&lt;td&gt;
	    A Low Resolution PDF is ready for review.&lt;br /&gt;&lt;br /&gt;
	    &lt;a href=&quot;http://thisisthelink.com&quot;&gt;This is the link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;/td&gt;
	&lt;/tr&gt;
	&lt;/table&gt;
	&lt;/body&gt;
&lt;/html&gt;';

$mail_object =&amp; Mail::factory('smtp', $params);
$mime = new Mail_mime($crlf);
$mime-&gt;setTXTBody($textMsg);
$mime-&gt;setHTMLBody($htmlMsg);
$mailGetParam[&quot;text_encoding&quot;] = &quot;7bit&quot;;
$mailGetParam[&quot;html_encoding&quot;] = &quot;quoted-printable&quot;;
$mailGetParam[&quot;html_charset&quot;] = &quot;ISO-8859-1&quot;;
$body = $mime-&gt;get($mailGetParam);
$hdrs = $mime-&gt;headers($headers);
$mailResult = $mail_object-&gt;send($headers['To'], $hdrs, $body);
?&gt;

Expected result:
----------------
An email that has a properly formatted To and Subject and the body 
looks like this:

A Low Resolution PDF is ready the review.

This is the link  

(where the link is an HTML anchor tag).

Actual result:
--------------
An email that has no &quot;To&quot; or &quot;Subject&quot;, and the body is raw source.

Received: from smtp.example.com ([127.0.0.1]) by 
some.smtp.example.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 19 Aug 2009 13:44:12 -0500
Received: from localhost ([10.26.26.168]) by some.smtp.example.com 
with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 19 Aug 2009 13:44:12 -0500
MIME-Version: 1.0
From: JSkibbie@schawk.com
Bcc:
Return-Path: JSkibbie@schawk.com
Message-ID: &lt;CORPEXCH013E1ioWwr20000010a@some.smtp.com&gt;
X-OriginalArrivalTime: 19 Aug 2009 18:44:12.0052 (UTC) 
FILETIME=[0B381540:01CA20FD]
Date: 19 Aug 2009 13:44:12 -0500

To: 
jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskib
bie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@
schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@scha
wk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.co
m,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jsk
ibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie
@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sch
awk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.c
om,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,js
kibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbi
e@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sc
hawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk
.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,
jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskib
bie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@
schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@scha
wk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.co
m,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jsk
ibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie
@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sch
awk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.c
om,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,js
kibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbi
e@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sc
hawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk
.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,
jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskib
bie@schawk.com,jskibbie@schawk.com
From: jskibbie@schawk.com
Subject: This is the Subject
Reply-To: jskibbie@schawk.com
X-Mailer: PHP 5.x
Content-Type: multipart/alternative;
	boundary=&quot;=_522c61ee6f7504b0b1319875c844a01a&quot;
Return-Path: jskibbie@schawk.com
Message-ID: &lt;CORPEXBH02llNY30kkZ00000ae6@some.smtp.com&gt;
X-OriginalArrivalTime: 19 Aug 2009 18:44:12.0207 (UTC) 
FILETIME=[0B4FBBF0:01CA20FD]
Date: 19 Aug 2009 13:44:12 -0500

--=_522c61ee6f7504b0b1319875c844a01a
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;

A Low Resolution PDF is ready for review.

Please use this link download a compressed archive of the PDF file:

http://thisisthelink.com
--=_522c61ee6f7504b0b1319875c844a01a
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;


&lt;html&gt;
	&lt;head&gt;
    &lt;meta http-equiv=3D&quot;Content-Type&quot; content=3D&quot;text/html;
charset=3DISO-88=
59-1&quot;&gt;
    &lt;title&gt;This is the Subject&lt;/title&gt;
    &lt;style type=3D&quot;text/css&quot; media=3D&quot;screen&quot;&gt;
    /* &lt;![CDATA[ */
      body{
        font: 12px Arial,Helvetica,Verdana,Sans-serif;
      }
      a{
        font-size: .9em;
      }
      a:link{
      	text-decoration: none;
      }
      a:visited {
      	text-decoration: none;
      }
      a:hover {
      	text-decoration: none;
      	color: orange;
      	border-bottom: 2px dotted orange;
      }
      a:active {
        color: red;
        border-bottom: 2px dotted red;
      }
    /* ]]&gt; */
    &lt;/style&gt;

  &lt;/head&gt;
	&lt;body&gt;
	&lt;table border=3D&quot;0&quot; cellspacing=3D&quot;0&quot; cellpadding=3D&quot;0&quot;&gt;
	&lt;tr&gt;
	&lt;td&gt;
	    A Low Resolution PDF is ready for review.&lt;br /&gt;&lt;br /&gt;
	    &lt;a href=3D&quot;http://thisisthelink.com&quot;&gt;This is the link&lt;/a&gt;&lt;br /
&gt;&lt;br /&gt;
	&lt;/td&gt;
	&lt;/tr&gt;
	&lt;/table&gt;
	&lt;/body&gt;
&lt;/html&gt;
--=_522c61ee6f7504b0b1319875c844a01a--</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by skibster
2009-08-19T20:15:09+00:00
PHP: 5.1.2 OS: 10.3.9 Package Version: 1.5.2

Description:
------------
If the To header is set in a mixed message text/html, and the header is 
longer than 998 characters, the email body is displayed as the source 
text instead of as HTML.

According to RFC 2822, there is a method for 'folding' long headers. This 
should be implemented to avoid this issue.

Test script:
---------------
&lt;?php
require('Mail.php');
require('Mail/mime.php');
$smtpRelay = 'smtp.example.com';
$smtpPort = 25;
$crlf = &quot;\r\n&quot;;
$headers['To'] = &quot;jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com&quot;;

$headers['From'] = &quot;jskibbie@schawk.com&quot;;
$headers['Subject'] = &quot;This is the Subject&quot;;
$headers['Reply-To'] = $headers['From'];
$headers['X-Mailer'] = 'PHP 5.x';
$params[&quot;host&quot;] = $smtpRelay;
$params[&quot;port&quot;] = $smtpPort;

$textMsg = &quot;A Low Resolution PDF is ready for review.

Please use this link download a compressed archive of the PDF file:

http://thisisthelink.com&quot;;

$htmlMsg ='
&lt;html&gt;
	&lt;head&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=ISO-8859-1&quot;&gt;
    &lt;title&gt;'.$headers['Subject'].'&lt;/title&gt;
    &lt;/head&gt;
	&lt;body&gt;
	&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
	&lt;tr&gt;
	&lt;td&gt;
	    A Low Resolution PDF is ready for review.&lt;br /&gt;&lt;br /&gt;
	    &lt;a href=&quot;http://thisisthelink.com&quot;&gt;This is the link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
	&lt;/td&gt;
	&lt;/tr&gt;
	&lt;/table&gt;
	&lt;/body&gt;
&lt;/html&gt;';

$mail_object =&amp; Mail::factory('smtp', $params);
$mime = new Mail_mime($crlf);
$mime-&gt;setTXTBody($textMsg);
$mime-&gt;setHTMLBody($htmlMsg);
$mailGetParam[&quot;text_encoding&quot;] = &quot;7bit&quot;;
$mailGetParam[&quot;html_encoding&quot;] = &quot;quoted-printable&quot;;
$mailGetParam[&quot;html_charset&quot;] = &quot;ISO-8859-1&quot;;
$body = $mime-&gt;get($mailGetParam);
$hdrs = $mime-&gt;headers($headers);
$mailResult = $mail_object-&gt;send($headers['To'], $hdrs, $body);
?&gt;

Expected result:
----------------
An email that has a properly formatted To and Subject and the body 
looks like this:

A Low Resolution PDF is ready the review.

This is the link  

(where the link is an HTML anchor tag).

Actual result:
--------------
An email that has no &quot;To&quot; or &quot;Subject&quot;, and the body is raw source.

Received: from smtp.example.com ([127.0.0.1]) by 
some.smtp.example.com with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 19 Aug 2009 13:44:12 -0500
Received: from localhost ([10.26.26.168]) by some.smtp.example.com 
with Microsoft SMTPSVC(6.0.3790.3959);
	 Wed, 19 Aug 2009 13:44:12 -0500
MIME-Version: 1.0
From: JSkibbie@schawk.com
Bcc:
Return-Path: JSkibbie@schawk.com
Message-ID: &lt;CORPEXCH013E1ioWwr20000010a@some.smtp.com&gt;
X-OriginalArrivalTime: 19 Aug 2009 18:44:12.0052 (UTC) 
FILETIME=[0B381540:01CA20FD]
Date: 19 Aug 2009 13:44:12 -0500

To: 
jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskib
bie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@
schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@scha
wk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.co
m,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jsk
ibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie
@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sch
awk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.c
om,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,js
kibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbi
e@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sc
hawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk
.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,
jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskib
bie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@
schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@scha
wk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.co
m,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jsk
ibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie
@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sch
awk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.c
om,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,js
kibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbi
e@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@sc
hawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk
.com,jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,
jskibbie@schawk.com,jskibbie@schawk.com,jskibbie@schawk.com,jskib
bie@schawk.com,jskibbie@schawk.com
From: jskibbie@schawk.com
Subject: This is the Subject
Reply-To: jskibbie@schawk.com
X-Mailer: PHP 5.x
Content-Type: multipart/alternative;
	boundary=&quot;=_522c61ee6f7504b0b1319875c844a01a&quot;
Return-Path: jskibbie@schawk.com
Message-ID: &lt;CORPEXBH02llNY30kkZ00000ae6@some.smtp.com&gt;
X-OriginalArrivalTime: 19 Aug 2009 18:44:12.0207 (UTC) 
FILETIME=[0B4FBBF0:01CA20FD]
Date: 19 Aug 2009 13:44:12 -0500

--=_522c61ee6f7504b0b1319875c844a01a
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;

A Low Resolution PDF is ready for review.

Please use this link download a compressed archive of the PDF file:

http://thisisthelink.com
--=_522c61ee6f7504b0b1319875c844a01a
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;


&lt;html&gt;
	&lt;head&gt;
    &lt;meta http-equiv=3D&quot;Content-Type&quot; content=3D&quot;text/html;
charset=3DISO-88=
59-1&quot;&gt;
    &lt;title&gt;This is the Subject&lt;/title&gt;
    &lt;style type=3D&quot;text/css&quot; media=3D&quot;screen&quot;&gt;
    /* &lt;![CDATA[ */
      body{
        font: 12px Arial,Helvetica,Verdana,Sans-serif;
      }
      a{
        font-size: .9em;
      }
      a:link{
      	text-decoration: none;
      }
      a:visited {
      	text-decoration: none;
      }
      a:hover {
      	text-decoration: none;
      	color: orange;
      	border-bottom: 2px dotted orange;
      }
      a:active {
        color: red;
        border-bottom: 2px dotted red;
      }
    /* ]]&gt; */
    &lt;/style&gt;

  &lt;/head&gt;
	&lt;body&gt;
	&lt;table border=3D&quot;0&quot; cellspacing=3D&quot;0&quot; cellpadding=3D&quot;0&quot;&gt;
	&lt;tr&gt;
	&lt;td&gt;
	    A Low Resolution PDF is ready for review.&lt;br /&gt;&lt;br /&gt;
	    &lt;a href=3D&quot;http://thisisthelink.com&quot;&gt;This is the link&lt;/a&gt;&lt;br /
&gt;&lt;br /&gt;
	&lt;/td&gt;
	&lt;/tr&gt;
	&lt;/table&gt;
	&lt;/body&gt;
&lt;/html&gt;
--=_522c61ee6f7504b0b1319875c844a01a--</pre>]]></description>
      <dc:date>2009-08-19T20:15:09+00:00</dc:date>
      <dc:creator>jskibbie &amp;#x61;&amp;#116; schawk &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16493">
      <title>Mail_Mime: Bug 16493 [Open] The charset for the headers cannot be set</title>
      <link>http://pear.php.net/bugs/16493</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by boernd
2009-08-04T17:14:35+00:00
PHP: 5.2.5 OS: Ubuntu Package Version: 1.5.2

Description:
------------
Currently the only way of setting the charset for the headers is to call the get function of the mime class. It would be better to be able to set the charset separately since sometimes you need to manage the headers before calling get.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by boernd
2009-08-04T17:14:35+00:00
PHP: 5.2.5 OS: Ubuntu Package Version: 1.5.2

Description:
------------
Currently the only way of setting the charset for the headers is to call the get function of the mime class. It would be better to be able to set the charset separately since sometimes you need to manage the headers before calling get.</pre>]]></description>
      <dc:date>2009-08-04T17:14:35+00:00</dc:date>
      <dc:creator>bernd &amp;#x61;&amp;#116; oliverklee &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/16363">
      <title>Mail_Mime: Bug 16363 [Open] Charset for multipart/related unset. Suggest setting using head_charset.</title>
      <link>http://pear.php.net/bugs/16363</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by leonardjo
2009-06-22T15:52:18+00:00
PHP: Irrelevant OS: irrelevant Package Version: 1.5.2

Description:
------------
When creating multipart/related parts no charset is set in the (part)header. I suggest using the _build_params['head_charset'] for this.

--- mime.php.000	2008-02-19 18:56:36.000000000 +0100
+++ mime.php	2009-06-22 16:34:43.000000000 +0200
@@ -505,6 +505,7 @@ class Mail_mime
     function &amp;_addRelatedPart(&amp;$obj)
     {
         $params['content_type'] = 'multipart/related';
+        $params['charset']      = $this-&gt;_build_params['head_charset'];
         if (is_object($obj)) {
             return $obj-&gt;addSubpart('', $params);
         } else {</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by leonardjo
2009-06-22T15:52:18+00:00
PHP: Irrelevant OS: irrelevant Package Version: 1.5.2

Description:
------------
When creating multipart/related parts no charset is set in the (part)header. I suggest using the _build_params['head_charset'] for this.

--- mime.php.000	2008-02-19 18:56:36.000000000 +0100
+++ mime.php	2009-06-22 16:34:43.000000000 +0200
@@ -505,6 +505,7 @@ class Mail_mime
     function &amp;_addRelatedPart(&amp;$obj)
     {
         $params['content_type'] = 'multipart/related';
+        $params['charset']      = $this-&gt;_build_params['head_charset'];
         if (is_object($obj)) {
             return $obj-&gt;addSubpart('', $params);
         } else {</pre>]]></description>
      <dc:date>2009-06-23T00:21:04+00:00</dc:date>
      <dc:creator>leonard-php-bugs &amp;#x61;&amp;#116; ottolander &amp;#x64;&amp;#111;&amp;#x74; nl</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15888">
      <title>Mail_Mime: Bug 15888 [Verified] attachment name/filename header lacks semicolon separator</title>
      <link>http://pear.php.net/bugs/15888</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2009-02-10T07:44:01+00:00
PHP: 5.2.8 OS:  Package Version: 

Description:
------------
Now:
Content-Disposition: attachment;
 filename*0*=&quot;UTF-8''very long long long filename filename filename foo bar&quot;
 filename*1*=&quot;boo baz bang&quot;;

Should be:
Content-Disposition: attachment;
 filename*0*=&quot;UTF-8''very long long long filename filename filename foo bar&quot;;
 filename*1*=&quot;boo baz bang&quot;;
 

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2009-02-10T07:44:01+00:00
PHP: 5.2.8 OS:  Package Version: 

Description:
------------
Now:
Content-Disposition: attachment;
 filename*0*=&quot;UTF-8''very long long long filename filename filename foo bar&quot;
 filename*1*=&quot;boo baz bang&quot;;

Should be:
Content-Disposition: attachment;
 filename*0*=&quot;UTF-8''very long long long filename filename filename foo bar&quot;;
 filename*1*=&quot;boo baz bang&quot;;
 

Test script:
---------------
      

Expected result:
----------------
      

Actual result:
--------------</pre>]]></description>
      <dc:date>2009-08-25T09:00:32+00:00</dc:date>
      <dc:creator>alec &amp;#x61;&amp;#116; alec &amp;#x64;&amp;#111;&amp;#x74; pl</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/15320">
      <title>Mail_Mime: Bug 15320 [Analyzed] attachment charset is not set in Content-Type header</title>
      <link>http://pear.php.net/bugs/15320</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2008-12-16T07:45:34+00:00
PHP: 5.2.8 OS:  Package Version: CVS

Description:
------------
patch: http://trac.roundcube.net/changeset/2154</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2008-12-16T07:45:34+00:00
PHP: 5.2.8 OS:  Package Version: CVS

Description:
------------
patch: http://trac.roundcube.net/changeset/2154</pre>]]></description>
      <dc:date>2008-12-27T00:21:32+00:00</dc:date>
      <dc:creator>alec &amp;#x61;&amp;#116; alec &amp;#x64;&amp;#111;&amp;#x74; pl</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14780">
      <title>Mail_Mime: Bug 14780 [Open] Content-Type: Multipart/alternative is not set correctly.</title>
      <link>http://pear.php.net/bugs/14780</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by pf
2008-10-12T17:05:18+00:00
PHP: 5.2.6 OS: Windows XP Package Version: 1.5.2

Description:
------------
If you call Mail_mime::headers() before Mail_mime::get(), no content type header is set. A work around for simple message is to include content-type in header list when calling Mail_mime::headers(). 

But for a multipart message, it is not possible to get message boundary to construct 'content-type: multipart/alternative; bournary=&quot;???&quot;'. There is a simple solution that has not been document. First call Mail_mime::get() to get message body. This call also update message headers. Then call Mail_mime::headers() to get headers.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by pf
2008-10-12T17:05:18+00:00
PHP: 5.2.6 OS: Windows XP Package Version: 1.5.2

Description:
------------
If you call Mail_mime::headers() before Mail_mime::get(), no content type header is set. A work around for simple message is to include content-type in header list when calling Mail_mime::headers(). 

But for a multipart message, it is not possible to get message boundary to construct 'content-type: multipart/alternative; bournary=&quot;???&quot;'. There is a simple solution that has not been document. First call Mail_mime::get() to get message body. This call also update message headers. Then call Mail_mime::headers() to get headers.</pre>]]></description>
      <dc:date>2008-12-08T04:31:22+00:00</dc:date>
      <dc:creator>poon &amp;#x64;&amp;#111;&amp;#x74; fung &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14597">
      <title>Mail_Mime: Bug 14597 [Open] Factory with smtp and Mime gets email wrong</title>
      <link>http://pear.php.net/bugs/14597</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by rvwilliams
2008-09-04T15:07:32+00:00
PHP: 4.4.4 OS: Debian Etch Package Version: 1.5.2

Description:
------------
The email created by the code below wrongly includes the Content-Type and Content-Transfer-Encoding lines so is never recognized as HTML.  Change the Factory from 'smtp' to 'mail' and the email is correct by of course not sent via the supplied $host.

Test script:
---------------
function new_mail($from,$to,$subject,$html,$host,$username,$password){
	ini_set(&quot;include_path&quot;, &quot;:&quot;.&quot;/usr/share/php/&quot;);
	require_once &quot;Mail.php&quot;;
	require_once &quot;Mail/mime.php&quot;;
	$headers = array ('From' =&gt; $from,
	'To' =&gt; $to,
	'Subject' =&gt; $subject);
	$message=new Mail_mime();
	$message-&gt;setHTMLBody($html);
	$body=$message-&gt;get();
	$headers=$message-&gt;headers($headers);
	$mail =&amp; Mail::factory('smtp',array ('host' =&gt; $host,'debug'=&gt;true,'port'=&gt;2525,'auth' =&gt; true,'username' =&gt; $username,'password' =&gt; $password));
	$mail1 = $mail-&gt;send($to, $headers, $body);
	if (PEAR::isError($mail1)) {
		die(&quot;&lt;p&gt;&quot; . $mail1-&gt;getMessage() . &quot;&lt;/p&gt;&quot;);
	} else {
		return(true);
	}
}

Expected result:
----------------
I expect to see this:
Position: b a-Africa_Fact_Book_(tmr)_-_Name: a c-Company_Name: c chosen: North Africa d-Address: d e-Postcode: e f-Country: f g-E-mail: g g-Web: h h-Phone: i 
What I actually see is this:
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;
Content-Transfer-Encoding: quoted-printable

&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;
Position: b
a-Africa_Fact_Book_(tmr)_-_Name: a
c-Company_Name: c
chosen: North Africa
d-Address: d
e-Postcode: e
f-Country: f
g-E-mail: g
g-Web: h
h-Phone: i

&lt;/BODY&gt;&lt;/HTML&gt; 

Actual result:
--------------
DEBUG: Recv: 220 cmsinfo.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Thu, 4 Sep 2008 20:50:27 +0100 DEBUG: Send: EHLO localhost DEBUG: Recv: 250-xxxxxx.com Hello [91.192.192.107] DEBUG: Recv: 250-TURN DEBUG: Recv: 250-SIZE DEBUG: Recv: 250-ETRN DEBUG: Recv: 250-PIPELINING DEBUG: Recv: 250-DSN DEBUG: Recv: 250-ENHANCEDSTATUSCODES DEBUG: Recv: 250-8bitmime DEBUG: Recv: 250-BINARYMIME DEBUG: Recv: 250-CHUNKING DEBUG: Recv: 250-VRFY DEBUG: Recv: 250-X-EXPS GSSAPI NTLM LOGIN DEBUG: Recv: 250-X-EXPS=LOGIN DEBUG: Recv: 250-AUTH GSSAPI NTLM LOGIN DEBUG: Recv: 250-AUTH=LOGIN DEBUG: Recv: 250-X-LINK2STATE DEBUG: Recv: 250-XEXCH50 DEBUG: Recv: 250 OK DEBUG: Send: AUTH LOGIN DEBUG: Recv: 334 VXNlcm5hbWU6 DEBUG: Send: c3R1ZGVudA== DEBUG: Recv: 334 UGFzc3dvcmQ6 DEBUG: Send: Mll3Mk1MY24= DEBUG: Recv: 235 2.7.0 Authentication successful. DEBUG: Send: EHLO localhost DEBUG: Recv: 250-xxxxxx.com Hello [91.192.192.107] DEBUG: Recv: 250-TURN DEBUG: Recv: 250-SIZE DEBUG: Recv: 250-ETRN DEBUG: Recv: 250-PIPELINING DEBUG: Recv: 250-DSN DEBUG: Recv: 250-ENHANCEDSTATUSCODES DEBUG: Recv: 250-8bitmime DEBUG: Recv: 250-BINARYMIME DEBUG: Recv: 250-CHUNKING DEBUG: Recv: 250-VRFY DEBUG: Recv: 250-X-EXPS GSSAPI NTLM LOGIN DEBUG: Recv: 250-X-EXPS=LOGIN DEBUG: Recv: 250-AUTH GSSAPI NTLM LOGIN DEBUG: Recv: 250-AUTH=LOGIN DEBUG: Recv: 250-X-LINK2STATE DEBUG: Recv: 250-XEXCH50 DEBUG: Recv: 250 OK DEBUG: Send: MAIL FROM: DEBUG: Recv: 250 2.1.0 admin@xxxxxx.com....Sender OK DEBUG: Send: RCPT TO: DEBUG: Recv: 250 2.1.5 keithw@xxxxxx.com DEBUG: Send: DATA DEBUG: Recv: 354 Start mail input; end with . DEBUG: Send: MIME-Version: 1.0 From: CMS Email Administrator To: keithw@xxxxxx.com Subject: Africa Fact Book Registration (tmr) Content-Type: text/html; charset=&quot;ISO-8859-1&quot; Content-Transfer-Encoding: quoted-printable Position: b a-Africa_Fact_Book_(tmr)_-_Name: a c-Company_Name: c chosen: North Africa d-Address: d e-Postcode: e f-Country: f g-E-mail: g g-Web: h h-Phone: i . DEBUG: Recv: 250 2.6.0  Queued mail for delivery DEBUG: Send: QUIT DEBUG: Recv: 221 2.0.0 xxxxxx.com Service closing transmission channel</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by rvwilliams
2008-09-04T15:07:32+00:00
PHP: 4.4.4 OS: Debian Etch Package Version: 1.5.2

Description:
------------
The email created by the code below wrongly includes the Content-Type and Content-Transfer-Encoding lines so is never recognized as HTML.  Change the Factory from 'smtp' to 'mail' and the email is correct by of course not sent via the supplied $host.

Test script:
---------------
function new_mail($from,$to,$subject,$html,$host,$username,$password){
	ini_set(&quot;include_path&quot;, &quot;:&quot;.&quot;/usr/share/php/&quot;);
	require_once &quot;Mail.php&quot;;
	require_once &quot;Mail/mime.php&quot;;
	$headers = array ('From' =&gt; $from,
	'To' =&gt; $to,
	'Subject' =&gt; $subject);
	$message=new Mail_mime();
	$message-&gt;setHTMLBody($html);
	$body=$message-&gt;get();
	$headers=$message-&gt;headers($headers);
	$mail =&amp; Mail::factory('smtp',array ('host' =&gt; $host,'debug'=&gt;true,'port'=&gt;2525,'auth' =&gt; true,'username' =&gt; $username,'password' =&gt; $password));
	$mail1 = $mail-&gt;send($to, $headers, $body);
	if (PEAR::isError($mail1)) {
		die(&quot;&lt;p&gt;&quot; . $mail1-&gt;getMessage() . &quot;&lt;/p&gt;&quot;);
	} else {
		return(true);
	}
}

Expected result:
----------------
I expect to see this:
Position: b a-Africa_Fact_Book_(tmr)_-_Name: a c-Company_Name: c chosen: North Africa d-Address: d e-Postcode: e f-Country: f g-E-mail: g g-Web: h h-Phone: i 
What I actually see is this:
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;
Content-Transfer-Encoding: quoted-printable

&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;
Position: b
a-Africa_Fact_Book_(tmr)_-_Name: a
c-Company_Name: c
chosen: North Africa
d-Address: d
e-Postcode: e
f-Country: f
g-E-mail: g
g-Web: h
h-Phone: i

&lt;/BODY&gt;&lt;/HTML&gt; 

Actual result:
--------------
DEBUG: Recv: 220 cmsinfo.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Thu, 4 Sep 2008 20:50:27 +0100 DEBUG: Send: EHLO localhost DEBUG: Recv: 250-xxxxxx.com Hello [91.192.192.107] DEBUG: Recv: 250-TURN DEBUG: Recv: 250-SIZE DEBUG: Recv: 250-ETRN DEBUG: Recv: 250-PIPELINING DEBUG: Recv: 250-DSN DEBUG: Recv: 250-ENHANCEDSTATUSCODES DEBUG: Recv: 250-8bitmime DEBUG: Recv: 250-BINARYMIME DEBUG: Recv: 250-CHUNKING DEBUG: Recv: 250-VRFY DEBUG: Recv: 250-X-EXPS GSSAPI NTLM LOGIN DEBUG: Recv: 250-X-EXPS=LOGIN DEBUG: Recv: 250-AUTH GSSAPI NTLM LOGIN DEBUG: Recv: 250-AUTH=LOGIN DEBUG: Recv: 250-X-LINK2STATE DEBUG: Recv: 250-XEXCH50 DEBUG: Recv: 250 OK DEBUG: Send: AUTH LOGIN DEBUG: Recv: 334 VXNlcm5hbWU6 DEBUG: Send: c3R1ZGVudA== DEBUG: Recv: 334 UGFzc3dvcmQ6 DEBUG: Send: Mll3Mk1MY24= DEBUG: Recv: 235 2.7.0 Authentication successful. DEBUG: Send: EHLO localhost DEBUG: Recv: 250-xxxxxx.com Hello [91.192.192.107] DEBUG: Recv: 250-TURN DEBUG: Recv: 250-SIZE DEBUG: Recv: 250-ETRN DEBUG: Recv: 250-PIPELINING DEBUG: Recv: 250-DSN DEBUG: Recv: 250-ENHANCEDSTATUSCODES DEBUG: Recv: 250-8bitmime DEBUG: Recv: 250-BINARYMIME DEBUG: Recv: 250-CHUNKING DEBUG: Recv: 250-VRFY DEBUG: Recv: 250-X-EXPS GSSAPI NTLM LOGIN DEBUG: Recv: 250-X-EXPS=LOGIN DEBUG: Recv: 250-AUTH GSSAPI NTLM LOGIN DEBUG: Recv: 250-AUTH=LOGIN DEBUG: Recv: 250-X-LINK2STATE DEBUG: Recv: 250-XEXCH50 DEBUG: Recv: 250 OK DEBUG: Send: MAIL FROM: DEBUG: Recv: 250 2.1.0 admin@xxxxxx.com....Sender OK DEBUG: Send: RCPT TO: DEBUG: Recv: 250 2.1.5 keithw@xxxxxx.com DEBUG: Send: DATA DEBUG: Recv: 354 Start mail input; end with . DEBUG: Send: MIME-Version: 1.0 From: CMS Email Administrator To: keithw@xxxxxx.com Subject: Africa Fact Book Registration (tmr) Content-Type: text/html; charset=&quot;ISO-8859-1&quot; Content-Transfer-Encoding: quoted-printable Position: b a-Africa_Fact_Book_(tmr)_-_Name: a c-Company_Name: c chosen: North Africa d-Address: d e-Postcode: e f-Country: f g-E-mail: g g-Web: h h-Phone: i . DEBUG: Recv: 250 2.6.0  Queued mail for delivery DEBUG: Send: QUIT DEBUG: Recv: 221 2.0.0 xxxxxx.com Service closing transmission channel</pre>]]></description>
      <dc:date>2008-09-04T15:07:32+00:00</dc:date>
      <dc:creator>richard &amp;#x61;&amp;#116; everything4it &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14529">
      <title>Mail_Mime: Bug 14529 [Open] basename() problem with utf-8</title>
      <link>http://pear.php.net/bugs/14529</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2008-08-20T02:29:50+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
basename function is not utf-8 safe and there're known issues with it. See comments on http://php.net/manual/en/function.basename.php</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by alec
2008-08-20T02:29:50+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
basename function is not utf-8 safe and there're known issues with it. See comments on http://php.net/manual/en/function.basename.php</pre>]]></description>
      <dc:date>2008-08-20T02:29:50+00:00</dc:date>
      <dc:creator>alec &amp;#x61;&amp;#116; alec &amp;#x64;&amp;#111;&amp;#x74; pl</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14390">
      <title>Mail_Mime: Bug 14390 [Open] attachments not correctly escaped</title>
      <link>http://pear.php.net/bugs/14390</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by brother
2008-07-22T15:05:32+00:00
PHP: 5.2.6 OS: Debian GNU/Linux Sid Package Version: CVS

Description:
------------
I've got an text file (a .po-file to be precise) with a ' (apostrophe) in it. 
When reading the file with the code in the area for test script  the file read ends at the first ' and the attachment is incomplete.

----

brother@zond:~$ file Desktop/translation/sent/080721/krb5.po 
Desktop/translation/sent/080721/krb5.po: UTF-8 Unicode English text, with very long lines


brother@zond:~$ pear version
PEAR Version: 1.7.1
PHP Version: 5.2.6-2
Zend Engine Version: 2.2.0
Running on: Linux zond 2.6.24-1-amd64 #1 SMP Thu May 8 03:30:20 UTC 2008 x86_64 

Test script:
---------------
$mime-&gt;addAttachment($basedir.&quot;sv.po&quot;, 'text/plain');

Expected result:
----------------
The file should be added with correctly escape in use.

Actual result:
--------------
not applicable</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by brother
2008-07-22T15:05:32+00:00
PHP: 5.2.6 OS: Debian GNU/Linux Sid Package Version: CVS

Description:
------------
I've got an text file (a .po-file to be precise) with a ' (apostrophe) in it. 
When reading the file with the code in the area for test script  the file read ends at the first ' and the attachment is incomplete.

----

brother@zond:~$ file Desktop/translation/sent/080721/krb5.po 
Desktop/translation/sent/080721/krb5.po: UTF-8 Unicode English text, with very long lines


brother@zond:~$ pear version
PEAR Version: 1.7.1
PHP Version: 5.2.6-2
Zend Engine Version: 2.2.0
Running on: Linux zond 2.6.24-1-amd64 #1 SMP Thu May 8 03:30:20 UTC 2008 x86_64 

Test script:
---------------
$mime-&gt;addAttachment($basedir.&quot;sv.po&quot;, 'text/plain');

Expected result:
----------------
The file should be added with correctly escape in use.

Actual result:
--------------
not applicable</pre>]]></description>
      <dc:date>2008-07-25T22:04:37+00:00</dc:date>
      <dc:creator>brother &amp;#x61;&amp;#116; bsnet &amp;#x64;&amp;#111;&amp;#x74; se</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14232">
      <title>Mail_Mime: Feature/Change Request 14232 [Open] RFC2231: Improve tspecials encoding in _buildHeaderParam()</title>
      <link>http://pear.php.net/bugs/14232</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by alec
2008-06-25T01:27:13+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
According to RFC2231/2047 special characters ie. ', &quot;, etc. (in RFC's named 'tspecials') must be encoded like other non-ascii characters.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by alec
2008-06-25T01:27:13+00:00
PHP: 5.2.6 OS:  Package Version: CVS

Description:
------------
According to RFC2231/2047 special characters ie. ', &quot;, etc. (in RFC's named 'tspecials') must be encoded like other non-ascii characters.</pre>]]></description>
      <dc:date>2008-07-26T08:45:54+00:00</dc:date>
      <dc:creator>alec &amp;#x61;&amp;#116; alec &amp;#x64;&amp;#111;&amp;#x74; pl</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13969">
      <title>Mail_Mime: Feature/Change Request 13969 [Open] Patch to stream attachments to counter memory issues</title>
      <link>http://pear.php.net/bugs/13969</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by till
2008-05-23T14:38:47+00:00
PHP: 5.2.5 OS: any Package Version: 1.5.2

Description:
------------
Here is a link to a patch which one of our users supplied us with. It also contains a patch against Mail_mime to add the possibility to stream attachments because when you read larger attachments into the memory, you constantly run into the memory_limit:

http://public.lanl.gov/jbarbuc/patches/roundcube/

Let me know if I can help to apply this.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by till
2008-05-23T14:38:47+00:00
PHP: 5.2.5 OS: any Package Version: 1.5.2

Description:
------------
Here is a link to a patch which one of our users supplied us with. It also contains a patch against Mail_mime to add the possibility to stream attachments because when you read larger attachments into the memory, you constantly run into the memory_limit:

http://public.lanl.gov/jbarbuc/patches/roundcube/

Let me know if I can help to apply this.</pre>]]></description>
      <dc:date>2008-05-26T07:32:23+00:00</dc:date>
      <dc:creator>till &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13962">
      <title>Mail_Mime: Feature/Change Request 13962 [Open] Improve Multiple header support</title>
      <link>http://pear.php.net/bugs/13962</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by kawai
2008-05-23T01:27:58+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.5.2

Description:
------------
Current 1.5.2 have a problem when we want to pass a multiple headers that has the same header name like 'Received:'.


Mail_mimeDecode serves the header as an array if the mail has multiple header.

Test script:
---------------
&lt;?php
require_once('Mail/mime.php');
require_once('Mail/mimeDecode.php');

$txt=join(&quot;\r\n&quot;, array(&quot;Recieved: TX-POST id zwr1333; Fri, 23 May 2008 12:41:40 +0900 (JST)&quot;,
&quot;Recieved: TX-POST2 id far123dp; Fri, 23 May 2008 12:41:35 +0900 (JST)&quot;,
&quot;From: sample@example.jp&quot;,
&quot;&quot;,
&quot;sample code&quot;));

$obj = new Mail_mimeDecode($txt);
$mail = $obj-&gt;decode();

$mime = new Mail_mime();
$r = $mime-&gt;txtHeaders($mail-&gt;headers);
var_dump($r);


Expected result:
----------------
string(184) &quot;MIME-Version: 1.0
recieved: TX-POST id zwr1333; Fri, 23 May 2008 12:41:40 +0900 (JST)
recieved: TX-POST2 id far123dp; Fri, 23 May 2008 12:41:35 +0900 (JST)
from: sample@example.jp
&quot;


Actual result:
--------------
&lt;br /&gt;
&lt;b&gt;Warning&lt;/b&gt;:  preg_match() expects parameter 2 to be string, array given in &lt;b&gt;D:\apache\front\libphp\Mail\mime.php&lt;/b&gt; on line &lt;b&gt;927&lt;/b&gt;&lt;br /&gt;
string(61) &quot;MIME-Version: 1.0
recieved: Array
from: sample@example.jp
&quot;</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by kawai
2008-05-23T01:27:58+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.5.2

Description:
------------
Current 1.5.2 have a problem when we want to pass a multiple headers that has the same header name like 'Received:'.


Mail_mimeDecode serves the header as an array if the mail has multiple header.

Test script:
---------------
&lt;?php
require_once('Mail/mime.php');
require_once('Mail/mimeDecode.php');

$txt=join(&quot;\r\n&quot;, array(&quot;Recieved: TX-POST id zwr1333; Fri, 23 May 2008 12:41:40 +0900 (JST)&quot;,
&quot;Recieved: TX-POST2 id far123dp; Fri, 23 May 2008 12:41:35 +0900 (JST)&quot;,
&quot;From: sample@example.jp&quot;,
&quot;&quot;,
&quot;sample code&quot;));

$obj = new Mail_mimeDecode($txt);
$mail = $obj-&gt;decode();

$mime = new Mail_mime();
$r = $mime-&gt;txtHeaders($mail-&gt;headers);
var_dump($r);


Expected result:
----------------
string(184) &quot;MIME-Version: 1.0
recieved: TX-POST id zwr1333; Fri, 23 May 2008 12:41:40 +0900 (JST)
recieved: TX-POST2 id far123dp; Fri, 23 May 2008 12:41:35 +0900 (JST)
from: sample@example.jp
&quot;


Actual result:
--------------
&lt;br /&gt;
&lt;b&gt;Warning&lt;/b&gt;:  preg_match() expects parameter 2 to be string, array given in &lt;b&gt;D:\apache\front\libphp\Mail\mime.php&lt;/b&gt; on line &lt;b&gt;927&lt;/b&gt;&lt;br /&gt;
string(61) &quot;MIME-Version: 1.0
recieved: Array
from: sample@example.jp
&quot;</pre>]]></description>
      <dc:date>2008-05-24T02:27:26+00:00</dc:date>
      <dc:creator>hiroaki &amp;#x64;&amp;#111;&amp;#x74; kawai &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13641">
      <title>Mail_Mime: Bug 13641 [Open] iconv_mime_encode seems to work different/errorious than the build in logic</title>
      <link>http://pear.php.net/bugs/13641</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by janslabon
2008-04-10T11:11:58+00:00
PHP: 5.2.5 OS: Linux / Gentoo Package Version: 1.5.2

Description:
------------
When using the iconv_mime_encode function with a long subject several email clients (or the email servers?) will destroy the header if they include own header lines.

We could reproduce this on web.de and on a lotus notes server.

If we use &quot;ignore-iconv&quot; =&gt; true in the build_params the error didn't occurs.

Test script:
---------------
require_once('Mail/mime.php');
$mime =&amp; new Mail_mime(&quot;\n&quot;); 

$subject = 'âThis is a long textâ and will force the subject to be on several lines.';

$build_params = array(
    &quot;html_charset&quot; =&gt; &quot;UTF-8&quot;,
    &quot;text_charset&quot; =&gt; &quot;UTF-8&quot;,
    &quot;head_charset&quot; =&gt; &quot;UTF-8&quot;
);
$body = $mime-&gt;get($build_params);

$hdrs = $mime-&gt;headers(array('Subject' =&gt; $subject));
print_r($hdrs);

$build_params[&quot;ignore-iconv&quot;] = true;
$body = $mime-&gt;get($build_params);

$hdrs = $mime-&gt;headers(array('Subject' =&gt; $subject));
print_r($hdrs);

Actual result:
--------------
To: xxx.xxx@xxx.de
Subject: =?UTF-8?Q?=E2=80=9CThis=20is=20a=20long=20text=E2=80=9D=20and?=
X-MIMETrack: Itemize by SMTP Server on XXXXX/XXXX/XXX(Release 7.0.3|September 26, 2007) at
09.04.2008 17:14:56,
                Serialize by Notes Client on XXX XXX/AAAA/BBB(Release 6.0.1CF1|March
04, 2003) at 09.04.2008 17:22:45,
                Serialize complete at 09.04.2008 17:22:45
From: XXX@XXX.XXX.de
Date: Wed, 9 Apr 2008 17:14:56 +0200
Message-ID: &lt;OF4B32EFF7.0B8CCA74-ONC1257426.0053C403@LocalDomain&gt;

=?UTF-8?Q?=20will=20force=20the=20subject=20to=20be=20on=20several=20li?=
=?UTF-8?Q?nes.?=
MIME-Version: 1.0</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by janslabon
2008-04-10T11:11:58+00:00
PHP: 5.2.5 OS: Linux / Gentoo Package Version: 1.5.2

Description:
------------
When using the iconv_mime_encode function with a long subject several email clients (or the email servers?) will destroy the header if they include own header lines.

We could reproduce this on web.de and on a lotus notes server.

If we use &quot;ignore-iconv&quot; =&gt; true in the build_params the error didn't occurs.

Test script:
---------------
require_once('Mail/mime.php');
$mime =&amp; new Mail_mime(&quot;\n&quot;); 

$subject = 'âThis is a long textâ and will force the subject to be on several lines.';

$build_params = array(
    &quot;html_charset&quot; =&gt; &quot;UTF-8&quot;,
    &quot;text_charset&quot; =&gt; &quot;UTF-8&quot;,
    &quot;head_charset&quot; =&gt; &quot;UTF-8&quot;
);
$body = $mime-&gt;get($build_params);

$hdrs = $mime-&gt;headers(array('Subject' =&gt; $subject));
print_r($hdrs);

$build_params[&quot;ignore-iconv&quot;] = true;
$body = $mime-&gt;get($build_params);

$hdrs = $mime-&gt;headers(array('Subject' =&gt; $subject));
print_r($hdrs);

Actual result:
--------------
To: xxx.xxx@xxx.de
Subject: =?UTF-8?Q?=E2=80=9CThis=20is=20a=20long=20text=E2=80=9D=20and?=
X-MIMETrack: Itemize by SMTP Server on XXXXX/XXXX/XXX(Release 7.0.3|September 26, 2007) at
09.04.2008 17:14:56,
                Serialize by Notes Client on XXX XXX/AAAA/BBB(Release 6.0.1CF1|March
04, 2003) at 09.04.2008 17:22:45,
                Serialize complete at 09.04.2008 17:22:45
From: XXX@XXX.XXX.de
Date: Wed, 9 Apr 2008 17:14:56 +0200
Message-ID: &lt;OF4B32EFF7.0B8CCA74-ONC1257426.0053C403@LocalDomain&gt;

=?UTF-8?Q?=20will=20force=20the=20subject=20to=20be=20on=20several=20li?=
=?UTF-8?Q?nes.?=
MIME-Version: 1.0</pre>]]></description>
      <dc:date>2008-12-27T14:08:13+00:00</dc:date>
      <dc:creator>jan &amp;#x64;&amp;#111;&amp;#x74; slabon &amp;#x61;&amp;#116; setasign &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13468">
      <title>Mail_Mime: Feature/Change Request 13468 [Assigned] Add option to fetch http:// images/stylesheets</title>
      <link>http://pear.php.net/bugs/13468</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by walter
2008-03-22T16:54:13+00:00
PHP: Irrelevant OS:  Package Version: 1.5.2

Description:
------------
An increasing number of MUA's defaults to *not* fetching remote images in HTML email.

It could be a useful feature if Mail_mime could optionally search a HTML part for any http:// assets referenced, fetch them by HTTP, attach them to the message and rewrite the HTML part.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by walter
2008-03-22T16:54:13+00:00
PHP: Irrelevant OS:  Package Version: 1.5.2

Description:
------------
An increasing number of MUA's defaults to *not* fetching remote images in HTML email.

It could be a useful feature if Mail_mime could optionally search a HTML part for any http:// assets referenced, fetch them by HTTP, attach them to the message and rewrite the HTML part.</pre>]]></description>
      <dc:date>2008-03-22T17:05:14+00:00</dc:date>
      <dc:creator>walter &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13467">
      <title>Mail_Mime: Bug 13467 [Assigned] Wrong PHP Version listed in dependencies</title>
      <link>http://pear.php.net/bugs/13467</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by cipri
2008-03-22T10:57:17+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.5.2

Description:
------------
The PEAR website and the package.xml list different required PHP versions. Also since Mail_Mime depends on other packages, we need to also look at their requirements.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by cipri
2008-03-22T10:57:17+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.5.2

Description:
------------
The PEAR website and the package.xml list different required PHP versions. Also since Mail_Mime depends on other packages, we need to also look at their requirements.</pre>]]></description>
      <dc:date>2008-03-22T10:57:49+00:00</dc:date>
      <dc:creator>cipri &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13444">
      <title>Mail_Mime: Bug 13444 [Open] problem in multipart mail with txt, html and images</title>
      <link>http://pear.php.net/bugs/13444</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by sbaldiss
2008-03-20T06:43:52+00:00
PHP: 4.3.4 OS: irrilevant Package Version: 1.5.2

Description:
------------
I have a problem like bug #9725...
Sending a mail with txt part, html part and images generate a email with only html part visible (mail client Apple Mail)
the structure of generated mail is:

Content-Type: multipart/related;
   Content-Type: multipart/alternative;
       text version
       html version
   images

I think that the correct order is:
Content-Type: multipart/alternative;
   txt version
   Content-Type: multipart/related;
       html version
       images

I suggest to correct the mime.php at line number 706 with this code:
case $html AND !$attachments AND $html_images:
          if (isset($this-&gt;_txtbody)) {
		$message =&amp; $this-&gt;_addAlternativePart($null);
                $this-&gt;_addTextPart($message, $this-&gt;_txtbody);
		
		$ht =&amp; $this-&gt;_addRelatedPart($message);
                $this-&gt;_addHtmlPart($ht);
		
		for ($i = 0; $i &lt; count($this-&gt;_html_images); $i++) {
			$this-&gt;_addHtmlImagePart($ht, $this-&gt;_html_images[$i]);
		    }
            } else {
		$message =&amp; $this-&gt;_addRelatedPart($null);
                $this-&gt;_addHtmlPart($message);
		
		for ($i = 0; $i &lt; count($this-&gt;_html_images); $i++) {
			$this-&gt;_addHtmlImagePart($message, $this-&gt;_html_images[$i]);
		    }
            }
            break;

Test script:
---------------
$crlf = &quot;\n&quot;;
require_once('Mail/mime.php');
require_once('Mail.php');
$mime = new Mail_mime($crlf);
$hdrs = array('Subject'=&gt;'title', 'From'=&gt;'email@example.com');

$mime-&gt;setTxtBody('hello world');
$mime-&gt;setHTMLBody('&lt;html&gt;&lt;body&gt;&lt;img src=&quot;hello.jpg&quot;&gt;&lt;/body&gt;&lt;/html&gt;');
$mime-&gt;addHTMLImage('hello.jpg', 'image/jpeg', 'hello.jpg');

$body = $mime-&gt;get();
$hdrs = $mime-&gt;headers($hdrs, TRUE);

Expected result:
----------------
A email with the structure:
Content-Type: multipart/alternative;
   txt version
   Content-Type: multipart/related;
       html version
       images

Actual result:
--------------
A email with structure:
Content-Type: multipart/related;
   Content-Type: multipart/alternative;
       text version
       html version
   images</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by sbaldiss
2008-03-20T06:43:52+00:00
PHP: 4.3.4 OS: irrilevant Package Version: 1.5.2

Description:
------------
I have a problem like bug #9725...
Sending a mail with txt part, html part and images generate a email with only html part visible (mail client Apple Mail)
the structure of generated mail is:

Content-Type: multipart/related;
   Content-Type: multipart/alternative;
       text version
       html version
   images

I think that the correct order is:
Content-Type: multipart/alternative;
   txt version
   Content-Type: multipart/related;
       html version
       images

I suggest to correct the mime.php at line number 706 with this code:
case $html AND !$attachments AND $html_images:
          if (isset($this-&gt;_txtbody)) {
		$message =&amp; $this-&gt;_addAlternativePart($null);
                $this-&gt;_addTextPart($message, $this-&gt;_txtbody);
		
		$ht =&amp; $this-&gt;_addRelatedPart($message);
                $this-&gt;_addHtmlPart($ht);
		
		for ($i = 0; $i &lt; count($this-&gt;_html_images); $i++) {
			$this-&gt;_addHtmlImagePart($ht, $this-&gt;_html_images[$i]);
		    }
            } else {
		$message =&amp; $this-&gt;_addRelatedPart($null);
                $this-&gt;_addHtmlPart($message);
		
		for ($i = 0; $i &lt; count($this-&gt;_html_images); $i++) {
			$this-&gt;_addHtmlImagePart($message, $this-&gt;_html_images[$i]);
		    }
            }
            break;

Test script:
---------------
$crlf = &quot;\n&quot;;
require_once('Mail/mime.php');
require_once('Mail.php');
$mime = new Mail_mime($crlf);
$hdrs = array('Subject'=&gt;'title', 'From'=&gt;'email@example.com');

$mime-&gt;setTxtBody('hello world');
$mime-&gt;setHTMLBody('&lt;html&gt;&lt;body&gt;&lt;img src=&quot;hello.jpg&quot;&gt;&lt;/body&gt;&lt;/html&gt;');
$mime-&gt;addHTMLImage('hello.jpg', 'image/jpeg', 'hello.jpg');

$body = $mime-&gt;get();
$hdrs = $mime-&gt;headers($hdrs, TRUE);

Expected result:
----------------
A email with the structure:
Content-Type: multipart/alternative;
   txt version
   Content-Type: multipart/related;
       html version
       images

Actual result:
--------------
A email with structure:
Content-Type: multipart/related;
   Content-Type: multipart/alternative;
       text version
       html version
   images</pre>]]></description>
      <dc:date>2008-07-06T04:54:36+00:00</dc:date>
      <dc:creator>smailbox2005-mac &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; it</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13032">
      <title>Mail_Mime: Bug 13032 [Open] Incorrect Boundary For Multi Par w/Attchment</title>
      <link>http://pear.php.net/bugs/13032</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by aimitservices
2008-01-31T18:46:11+00:00
PHP: 5.2.5 OS: Gentoo Linux Package Version: 1.5.2

Description:
------------
When creating a multi part email message with HTML and Text alternative, with an attachment.  The mimePart.php file is creating the same boundary for the multi part/alternative and the attachment boundary.  This causes most web mail clients to not display, or allow the attachment to be downloaded.

I could not find any direct references to this bug, so I apologize if this is a duplicate.

Test script:
---------------
	$mime = new Mail_mime(&quot;\r\n&quot;);
	
	$mime-&gt;setHTMLBody($htmlMsg);

	
	$mime-&gt;setTXTBody($txtMsg);

$mime-&gt;addAttachment($fileName.&quot;.pdf&quot;, &quot;application/pdf&quot;, &quot;CompletionCertificate.pdf&quot;, true, 'base64', 'inline');

$msg = $mime-&gt;get();
$hdr = $mime-&gt;headers(....);

$mailer = MAIL::factory(&quot;mail&quot;);

$mailer-&gt;send($to, $hdr, $msg);

Expected result:
----------------
The message should display in HMTL or Text depending on the users mail client and preference, and should allow the user to download the attachment.  What happens in most web mail clients (stand alones such as Thunderbird, seem to work fine) is both the text and html are displayed and the attachment cannot be downloaded.

Actual result:
--------------
Not sure if this is the right box to put this , but.  
I actually edited the mimePart.php file and got the boundaries to create as expected.  On line 243 there is this line:
srand((double)microtime()*1000000);

This was causing the random boundary to be the same.  As of PHP 4.2, srand is no longer needed.  I would suggest adding version check line and only calling srand if &lt; 4.2.

In my case, I just commented the line out, and my emails started to work as expected.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by aimitservices
2008-01-31T18:46:11+00:00
PHP: 5.2.5 OS: Gentoo Linux Package Version: 1.5.2

Description:
------------
When creating a multi part email message with HTML and Text alternative, with an attachment.  The mimePart.php file is creating the same boundary for the multi part/alternative and the attachment boundary.  This causes most web mail clients to not display, or allow the attachment to be downloaded.

I could not find any direct references to this bug, so I apologize if this is a duplicate.

Test script:
---------------
	$mime = new Mail_mime(&quot;\r\n&quot;);
	
	$mime-&gt;setHTMLBody($htmlMsg);

	
	$mime-&gt;setTXTBody($txtMsg);

$mime-&gt;addAttachment($fileName.&quot;.pdf&quot;, &quot;application/pdf&quot;, &quot;CompletionCertificate.pdf&quot;, true, 'base64', 'inline');

$msg = $mime-&gt;get();
$hdr = $mime-&gt;headers(....);

$mailer = MAIL::factory(&quot;mail&quot;);

$mailer-&gt;send($to, $hdr, $msg);

Expected result:
----------------
The message should display in HMTL or Text depending on the users mail client and preference, and should allow the user to download the attachment.  What happens in most web mail clients (stand alones such as Thunderbird, seem to work fine) is both the text and html are displayed and the attachment cannot be downloaded.

Actual result:
--------------
Not sure if this is the right box to put this , but.  
I actually edited the mimePart.php file and got the boundaries to create as expected.  On line 243 there is this line:
srand((double)microtime()*1000000);

This was causing the random boundary to be the same.  As of PHP 4.2, srand is no longer needed.  I would suggest adding version check line and only calling srand if &lt; 4.2.

In my case, I just commented the line out, and my emails started to work as expected.</pre>]]></description>
      <dc:date>2008-01-31T18:46:11+00:00</dc:date>
      <dc:creator>derek &amp;#x61;&amp;#116; a--i--m &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12914">
      <title>Mail_Mime: Bug 12914 [Open] PHP5 doesn't accept subjects containing \n in Function mail()</title>
      <link>http://pear.php.net/bugs/12914</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by joliver
2008-01-15T21:03:37+00:00
PHP: 5.2.0 OS:  Package Version: 1.5.2

Description:
------------
PHP5 doesn't accept subjects containing \n in Function mail() any more.

&quot;Subject of the email to be sent. Caution: This must not contain any newline characters, or the mail may not be sent properly.&quot;

However Mail_Mime splits long subjects (especially with encoded special characters the subects becomes longer than 75 characters very soon).

Result: no mail is sent at all.

Your comment in mime.php:

//determine the maximum length of such strings.
//75 is the value specified in the RFC.

As far as i've seen that's only a suggestion in RFC. Longer lines in mailheaders are perfectly valid, too. So please provide an option to turn off linebreaks in subjects.

It seems that subjects containing \r\n are still accepted by mail() in PHP5. However postfix strictly requires \n

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447074</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by joliver
2008-01-15T21:03:37+00:00
PHP: 5.2.0 OS:  Package Version: 1.5.2

Description:
------------
PHP5 doesn't accept subjects containing \n in Function mail() any more.

&quot;Subject of the email to be sent. Caution: This must not contain any newline characters, or the mail may not be sent properly.&quot;

However Mail_Mime splits long subjects (especially with encoded special characters the subects becomes longer than 75 characters very soon).

Result: no mail is sent at all.

Your comment in mime.php:

//determine the maximum length of such strings.
//75 is the value specified in the RFC.

As far as i've seen that's only a suggestion in RFC. Longer lines in mailheaders are perfectly valid, too. So please provide an option to turn off linebreaks in subjects.

It seems that subjects containing \r\n are still accepted by mail() in PHP5. However postfix strictly requires \n

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447074</pre>]]></description>
      <dc:date>2008-01-15T21:03:37+00:00</dc:date>
      <dc:creator>joliver &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; at</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12716">
      <title>Mail_Mime: Bug 12716 [Open] Invalid Content-Transfer-Encdoing on multipart messages</title>
      <link>http://pear.php.net/bugs/12716</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by jjr
2007-12-18T00:26:22+00:00
PHP: Irrelevant OS: UNIX Package Version: 1.5.2

Description:
------------
An email generated by Mail_Mime had the following headers.

...
MIME-Version: 1.0
From: &lt;xxx@xxx.xxx.xx&gt;
Content-Type: multipart/alternative;
        boundary=&quot;=_90be54e8dab1de0e2d340c1331fbc037&quot;
Content-Transfer-Encoding: quoted-printable
...

According to
http://tools.ietf.org/html/rfc2045#section-6.4
this is in error. From the RFC:
   Certain Content-Transfer-Encoding values may only be 
used on certain
   media types.  In particular, it is EXPRESSLY FORBIDDEN 
to use any
   encodings other than &quot;7bit&quot;, &quot;8bit&quot;, or &quot;binary&quot; with 
any composite
   media type, i.e. one that recursively includes other 
Content-Type
   fields.  Currently the only composite media types 
are &quot;multipart&quot; and
   &quot;message&quot;.  All encodings that are desired for bodies 
of type
   multipart or message must be done at the innermost 
level, by encoding
   the actual body that needs to be encoded.


Please include
francois@getup.org.au
in followups since while I noticed the problem, Francois 
is managing the system.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by jjr
2007-12-18T00:26:22+00:00
PHP: Irrelevant OS: UNIX Package Version: 1.5.2

Description:
------------
An email generated by Mail_Mime had the following headers.

...
MIME-Version: 1.0
From: &lt;xxx@xxx.xxx.xx&gt;
Content-Type: multipart/alternative;
        boundary=&quot;=_90be54e8dab1de0e2d340c1331fbc037&quot;
Content-Transfer-Encoding: quoted-printable
...

According to
http://tools.ietf.org/html/rfc2045#section-6.4
this is in error. From the RFC:
   Certain Content-Transfer-Encoding values may only be 
used on certain
   media types.  In particular, it is EXPRESSLY FORBIDDEN 
to use any
   encodings other than &quot;7bit&quot;, &quot;8bit&quot;, or &quot;binary&quot; with 
any composite
   media type, i.e. one that recursively includes other 
Content-Type
   fields.  Currently the only composite media types 
are &quot;multipart&quot; and
   &quot;message&quot;.  All encodings that are desired for bodies 
of type
   multipart or message must be done at the innermost 
level, by encoding
   the actual body that needs to be encoded.


Please include
francois@getup.org.au
in followups since while I noticed the problem, Francois 
is managing the system.</pre>]]></description>
      <dc:date>2007-12-18T00:26:22+00:00</dc:date>
      <dc:creator>joel &amp;#x61;&amp;#116; panacea &amp;#x64;&amp;#111;&amp;#x74; null &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12628">
      <title>Mail_Mime: Bug 12628 [Open] Extra newline causes invalid Mime, breaks GMail</title>
      <link>http://pear.php.net/bugs/12628</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by richardlynch
2007-12-06T11:09:19+00:00
PHP: 4.4.7 OS: Gentoo Package Version: 1.5.2

Description:
------------
An extra newline in the main &quot;Content-type:&quot; header right before the boundary= bit makes for invalid MIME according to this Mime Lint tool:
http://www.apps.ietf.org/msglint.html

Gmail fails to display the message and shoves all the content into an &quot;noname&quot; attachment.

Gmail *hates* extra newlines and *hates* \r\n in the headers :-(

A sample message output is provided in &quot;Test script:&quot;

The actual PHP code is pretty much lifted verbatim from the example on php.net so I won't bore you with it.


Test script:
---------------
Delivered-To: richardlynchchicago@gmail.com
Received: by 10.142.48.18 with SMTP id v18cs64351wfv;
        Thu, 6 Dec 2007 07:01:10 -0800 (PST)
Received: by 10.100.214.15 with SMTP id m15mr6875501ang.1196953270369;
        Thu, 06 Dec 2007 07:01:10 -0800 (PST)
Return-Path: &lt;sagacitydev@mail.complaints.com&gt;
Received: from mail.complaints.com ([74.201.1.7])
        by mx.google.com with ESMTP id 36si556094nzk.2007.12.06.07.01.04;
        Thu, 06 Dec 2007 07:01:10 -0800 (PST)
Received-SPF: fail (google.com: domain of sagacitydev@mail.complaints.com does not designate 74.201.1.7 as permitted sender) client-ip=74.201.1.7;
Authentication-Results: mx.google.com; spf=hardfail (google.com: domain of sagacitydev@mail.complaints.com does not designate 74.201.1.7 as permitted sender) smtp.mail=sagacitydev@mail.complaints.com
Date: Thu, 06 Dec 2007 07:01:08 -0800 (PST)
Message-Id: &lt;47580eb4.240b240a.3257.ffffb848SMTPIN_ADDED@mx.google.com&gt;
Received: by mail.complaints.com (Postfix, from userid 1001)
	id 76F084AC25C; Thu,  6 Dec 2007 09:01:05 -0600 (CST)
To: &quot;Richard Lynch&quot; &lt;richardlynchchicago@gmail.com&gt;
Subject: Re: Test Complaint
MIME-Version: 1.0
From: &quot;Complaints.com&quot; &lt;webmaster@complaints.com&gt;
Reply-to: &quot;Complaints.com&quot; &lt;webmaster@complaints.com&gt;
Content-Type: multipart/alternative;

	boundary=&quot;=_9748ed5ba1974422fcf5f37c5b12b7d0&quot;
Message-Id: &lt;20071206150105.76F084AC25C@mail.complaints.com&gt;
Date: Thu,  6 Dec 2007 09:01:05 -0600 (CST)


--=_9748ed5ba1974422fcf5f37c5b12b7d0

Content-Transfer-Encoding: 7bit

Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;




Dear Richard Lynch;

Thank you for emailing us your Complaint.

You must visit this URL to finish:
https://post-dev.complaints.com/manage.php/9613e6684e4fa50d3b3b183ba8e65111

By emailing your message to Complaints.com you agree to the Terms/Privacy of Complaints.com
http://www-dev.complaints.com/terms_privacy.htm

-- 
Complaints.com - consumers in control

--=_9748ed5ba1974422fcf5f37c5b12b7d0

Content-Transfer-Encoding: quoted-printable

Content-Type: text/html; charset=&quot;ISO-8859-1&quot;




&lt;div style=3D&quot;color: red;&quot;&gt;

&lt;p&gt;Dear Richard Lynch;&lt;/p&gt;

&lt;p&gt;Thank you for emailing us your Complaint.&lt;/p&gt;

&lt;p&gt;You must visit this URL to finish:&lt;br /&gt;

&lt;a href=3D&quot;https://post-dev.complaints.com/manage.php/9613e6684e4fa50d3b3b1=

83ba8e65111&quot;&gt;https://post-dev.complaints.com/manage.php/9613e6684e4fa50d3b3=

b183ba8e65111&lt;/a&gt;

&lt;/p&gt;

&lt;p&gt;By emailing your message to Complaints.com you agree to the Terms/Privac=

y of Complaints.com&lt;br /&gt;

&lt;a href=3D&quot;http://www-dev.complaints.com/terms_privacy.htm&quot;&gt;http://www-dev.=

complaints.com/terms_privacy.htm&lt;/a&gt;&lt;br /&gt;

&lt;/div&gt;



--=20

Complaints.com - consumers in control

--=_9748ed5ba1974422fcf5f37c5b12b7d0--

Expected result:
----------------
I'd like to see that extra blank line before the boundary= in the headers gone so that the message is compliant, assuming the Lint tool is correct.

When I take it out, the Lint tool is much happier.

More importantly, I just want GMail users to be able to actually read the messages Mail_Mime generates.

Right now, I can't really use Mail_Mime because the boss uses gmail, so he goes to test the system, and kablooey. :-(

I had hoped this was all fixed in 1.4.0 as discussed in the last two notes of this bug report (which is two separate issues):
http://pear.php.net/bugs/bug.php?id=30

But it would seem that either an extra \r\n has crept back in, or there's just one too many \n in there, and it's yet another separate newline issue that freaks out the very brittle Gmail.

YOU ROCK!!!

PS
I've asked GMail support to lighten up and accept the not-quite-valid Mime, but I don't really expect that to yield results.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by richardlynch
2007-12-06T11:09:19+00:00
PHP: 4.4.7 OS: Gentoo Package Version: 1.5.2

Description:
------------
An extra newline in the main &quot;Content-type:&quot; header right before the boundary= bit makes for invalid MIME according to this Mime Lint tool:
http://www.apps.ietf.org/msglint.html

Gmail fails to display the message and shoves all the content into an &quot;noname&quot; attachment.

Gmail *hates* extra newlines and *hates* \r\n in the headers :-(

A sample message output is provided in &quot;Test script:&quot;

The actual PHP code is pretty much lifted verbatim from the example on php.net so I won't bore you with it.


Test script:
---------------
Delivered-To: richardlynchchicago@gmail.com
Received: by 10.142.48.18 with SMTP id v18cs64351wfv;
        Thu, 6 Dec 2007 07:01:10 -0800 (PST)
Received: by 10.100.214.15 with SMTP id m15mr6875501ang.1196953270369;
        Thu, 06 Dec 2007 07:01:10 -0800 (PST)
Return-Path: &lt;sagacitydev@mail.complaints.com&gt;
Received: from mail.complaints.com ([74.201.1.7])
        by mx.google.com with ESMTP id 36si556094nzk.2007.12.06.07.01.04;
        Thu, 06 Dec 2007 07:01:10 -0800 (PST)
Received-SPF: fail (google.com: domain of sagacitydev@mail.complaints.com does not designate 74.201.1.7 as permitted sender) client-ip=74.201.1.7;
Authentication-Results: mx.google.com; spf=hardfail (google.com: domain of sagacitydev@mail.complaints.com does not designate 74.201.1.7 as permitted sender) smtp.mail=sagacitydev@mail.complaints.com
Date: Thu, 06 Dec 2007 07:01:08 -0800 (PST)
Message-Id: &lt;47580eb4.240b240a.3257.ffffb848SMTPIN_ADDED@mx.google.com&gt;
Received: by mail.complaints.com (Postfix, from userid 1001)
	id 76F084AC25C; Thu,  6 Dec 2007 09:01:05 -0600 (CST)
To: &quot;Richard Lynch&quot; &lt;richardlynchchicago@gmail.com&gt;
Subject: Re: Test Complaint
MIME-Version: 1.0
From: &quot;Complaints.com&quot; &lt;webmaster@complaints.com&gt;
Reply-to: &quot;Complaints.com&quot; &lt;webmaster@complaints.com&gt;
Content-Type: multipart/alternative;

	boundary=&quot;=_9748ed5ba1974422fcf5f37c5b12b7d0&quot;
Message-Id: &lt;20071206150105.76F084AC25C@mail.complaints.com&gt;
Date: Thu,  6 Dec 2007 09:01:05 -0600 (CST)


--=_9748ed5ba1974422fcf5f37c5b12b7d0

Content-Transfer-Encoding: 7bit

Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;




Dear Richard Lynch;

Thank you for emailing us your Complaint.

You must visit this URL to finish:
https://post-dev.complaints.com/manage.php/9613e6684e4fa50d3b3b183ba8e65111

By emailing your message to Complaints.com you agree to the Terms/Privacy of Complaints.com
http://www-dev.complaints.com/terms_privacy.htm

-- 
Complaints.com - consumers in control

--=_9748ed5ba1974422fcf5f37c5b12b7d0

Content-Transfer-Encoding: quoted-printable

Content-Type: text/html; charset=&quot;ISO-8859-1&quot;




&lt;div style=3D&quot;color: red;&quot;&gt;

&lt;p&gt;Dear Richard Lynch;&lt;/p&gt;

&lt;p&gt;Thank you for emailing us your Complaint.&lt;/p&gt;

&lt;p&gt;You must visit this URL to finish:&lt;br /&gt;

&lt;a href=3D&quot;https://post-dev.complaints.com/manage.php/9613e6684e4fa50d3b3b1=

83ba8e65111&quot;&gt;https://post-dev.complaints.com/manage.php/9613e6684e4fa50d3b3=

b183ba8e65111&lt;/a&gt;

&lt;/p&gt;

&lt;p&gt;By emailing your message to Complaints.com you agree to the Terms/Privac=

y of Complaints.com&lt;br /&gt;

&lt;a href=3D&quot;http://www-dev.complaints.com/terms_privacy.htm&quot;&gt;http://www-dev.=

complaints.com/terms_privacy.htm&lt;/a&gt;&lt;br /&gt;

&lt;/div&gt;



--=20

Complaints.com - consumers in control

--=_9748ed5ba1974422fcf5f37c5b12b7d0--

Expected result:
----------------
I'd like to see that extra blank line before the boundary= in the headers gone so that the message is compliant, assuming the Lint tool is correct.

When I take it out, the Lint tool is much happier.

More importantly, I just want GMail users to be able to actually read the messages Mail_Mime generates.

Right now, I can't really use Mail_Mime because the boss uses gmail, so he goes to test the system, and kablooey. :-(

I had hoped this was all fixed in 1.4.0 as discussed in the last two notes of this bug report (which is two separate issues):
http://pear.php.net/bugs/bug.php?id=30

But it would seem that either an extra \r\n has crept back in, or there's just one too many \n in there, and it's yet another separate newline issue that freaks out the very brittle Gmail.

YOU ROCK!!!

PS
I've asked GMail support to lighten up and accept the not-quite-valid Mime, but I don't really expect that to yield results.</pre>]]></description>
      <dc:date>2008-05-01T09:46:46+00:00</dc:date>
      <dc:creator>ceo &amp;#x61;&amp;#116; l-i-e &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12551">
      <title>Mail_Mime: Bug 12551 [Open] dots on their own line sometimes not encoded</title>
      <link>http://pear.php.net/bugs/12551</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by frasersteen
2007-11-29T10:37:40+00:00
PHP: 5.2.3 OS: Linux Package Version: 1.5.2

Description:
------------
When a message is formatted in such a way that it creates a single line with a &quot;.&quot;, this signals end of message and truncates it.

Whem trying to send batches of emails this prevents more than a single truncated email to leave.

Test script:
---------------
From email body:
&gt;&gt;
....positive result=
.
Women shown to by....
&lt;&lt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by frasersteen
2007-11-29T10:37:40+00:00
PHP: 5.2.3 OS: Linux Package Version: 1.5.2

Description:
------------
When a message is formatted in such a way that it creates a single line with a &quot;.&quot;, this signals end of message and truncates it.

Whem trying to send batches of emails this prevents more than a single truncated email to leave.

Test script:
---------------
From email body:
&gt;&gt;
....positive result=
.
Women shown to by....
&lt;&lt;</pre>]]></description>
      <dc:date>2007-11-30T07:21:54+00:00</dc:date>
      <dc:creator>fsteen &amp;#x61;&amp;#116; premierit &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12466">
      <title>Mail_Mime: Bug 12466 [Open] wrong text_encoding or text_charset in get()</title>
      <link>http://pear.php.net/bugs/12466</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by cwiedmann
2007-11-17T04:25:47+00:00
PHP: 5.2.4 OS: Irrelevant Package Version: CVS

Description:
------------
In the $build_params for Mail_Mime::get():
  text_encoding = Default is 7bit
  text_charset  = Default is iso-8859-1
That's not possible, because ISO-8859-1 is a 8bit encoding.

At the moment I have no patch, because I need a direction to do this:
- setting text_encoding to &quot;8bit&quot;
- setting text_encoding to &quot;quoted-printable&quot;
- setting text_charset to &quot;US-ASCII&quot;

An additional feature:
In case of setting text_charset to an other value then &quot;US-ASCII&quot;, the class should also be smart enough, to change the text_encoding from &quot;7bit&quot; to &quot;8bit&quot; or &quot;quoted-printable&quot; automatically (if text_encoding is not set).

Regards,
Carsten</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by cwiedmann
2007-11-17T04:25:47+00:00
PHP: 5.2.4 OS: Irrelevant Package Version: CVS

Description:
------------
In the $build_params for Mail_Mime::get():
  text_encoding = Default is 7bit
  text_charset  = Default is iso-8859-1
That's not possible, because ISO-8859-1 is a 8bit encoding.

At the moment I have no patch, because I need a direction to do this:
- setting text_encoding to &quot;8bit&quot;
- setting text_encoding to &quot;quoted-printable&quot;
- setting text_charset to &quot;US-ASCII&quot;

An additional feature:
In case of setting text_charset to an other value then &quot;US-ASCII&quot;, the class should also be smart enough, to change the text_encoding from &quot;7bit&quot; to &quot;8bit&quot; or &quot;quoted-printable&quot; automatically (if text_encoding is not set).

Regards,
Carsten</pre>]]></description>
      <dc:date>2007-11-17T04:25:47+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_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12456">
      <title>Mail_Mime: Bug 12456 [Assigned] srand() causing complication on hardware with broken clock</title>
      <link>http://pear.php.net/bugs/12456</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by jonl
2007-11-15T14:44:35+00:00
PHP: 5.2.4 OS: Linux 2.6 Package Version: 1.5.2

Description:
------------
Mail/mimePart.php, function encode():

srand((double)microtime()*1000000);
$boundary = '=_' . md5(rand() . microtime());

My development server has a slow/stale clock due a broken SMI implementation (see http://lists.us.dell.com/pipermail/linux-poweredge/2004-July/015554.html) so microtime() often returns the same value across multiple microsecond.

Therefore, the &quot;randomness&quot; of $boundary depends on rand() to return different values during successive iterations of encode().

However, rand() is returning the same value (probably due to this same hardware interrupt problem affecting microtime())

This is causing a problem with multiple encodings within the same message.  For example, a message containing plaintext, HTML and a file attachment should have 2 different boundary strings like this:
&quot;
MIME-Version: 1.0
From: MY_EMAIL_ADDRESS
Subject: Test message: Thu, 15 Nov 07 14:31:10 -0500
Content-Type: multipart/mixed;
        boundary=&quot;=_fb952fbfe782713c888ca0ab55c41f19&quot;


--=_fb952fbfe782713c888ca0ab55c41f19
Content-Type: multipart/alternative;
        boundary=&quot;=_72d79573e8e611e59014b59ee526ad5f&quot;


--=_72d79573e8e611e59014b59ee526ad5f
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;

This is the plaintext body.
--=_72d79573e8e611e59014b59ee526ad5f
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;

&lt;b&gt;This is the HTML body.&lt;/b&gt;
--=_72d79573e8e611e59014b59ee526ad5f--

--=_fb952fbfe782713c888ca0ab55c41f19
Content-Transfer-Encoding: base64
Content-Type: text/plain;
 name=&quot;TestFile1.txt&quot;;
Content-Disposition: attachment;
 filename=&quot;TestFile1.txt&quot;;

Q29udGVudHMgb2YgVGVzdEZpbGUxLnR4dAo=
--=_fb952fbfe782713c888ca0ab55c41f19--
&quot;

But (intermittently) the message has the same boundary strings for both levels of encoding like this:
&quot;
MIME-Version: 1.0
From: MY_EMAIL_ADDRESS
Subject: Test message: Thu, 15 Nov 07 14:31:12 -0500
Content-Type: multipart/mixed;
        boundary=&quot;=_25b8085bab879c9b936de3ad92f5bee3&quot;


--=_25b8085bab879c9b936de3ad92f5bee3
Content-Type: multipart/alternative;
        boundary=&quot;=_25b8085bab879c9b936de3ad92f5bee3&quot;


--=_25b8085bab879c9b936de3ad92f5bee3--

--=_25b8085bab879c9b936de3ad92f5bee3
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;

This is the plaintext body.
--=_25b8085bab879c9b936de3ad92f5bee3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;

&lt;b&gt;This is the HTML body.&lt;/b&gt;
--=_25b8085bab879c9b936de3ad92f5bee3--
&quot;

Removing the call to srand() (in the line prior) stops this intermittent and problematic behavior:
//srand((double)microtime()*1000000);

And the PHP manual says that since PHP 4.2.0, srand() no longer needs to be called prior to rand() as rand() now automatically seeds the generator.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by jonl
2007-11-15T14:44:35+00:00
PHP: 5.2.4 OS: Linux 2.6 Package Version: 1.5.2

Description:
------------
Mail/mimePart.php, function encode():

srand((double)microtime()*1000000);
$boundary = '=_' . md5(rand() . microtime());

My development server has a slow/stale clock due a broken SMI implementation (see http://lists.us.dell.com/pipermail/linux-poweredge/2004-July/015554.html) so microtime() often returns the same value across multiple microsecond.

Therefore, the &quot;randomness&quot; of $boundary depends on rand() to return different values during successive iterations of encode().

However, rand() is returning the same value (probably due to this same hardware interrupt problem affecting microtime())

This is causing a problem with multiple encodings within the same message.  For example, a message containing plaintext, HTML and a file attachment should have 2 different boundary strings like this:
&quot;
MIME-Version: 1.0
From: MY_EMAIL_ADDRESS
Subject: Test message: Thu, 15 Nov 07 14:31:10 -0500
Content-Type: multipart/mixed;
        boundary=&quot;=_fb952fbfe782713c888ca0ab55c41f19&quot;


--=_fb952fbfe782713c888ca0ab55c41f19
Content-Type: multipart/alternative;
        boundary=&quot;=_72d79573e8e611e59014b59ee526ad5f&quot;


--=_72d79573e8e611e59014b59ee526ad5f
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;

This is the plaintext body.
--=_72d79573e8e611e59014b59ee526ad5f
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;

&lt;b&gt;This is the HTML body.&lt;/b&gt;
--=_72d79573e8e611e59014b59ee526ad5f--

--=_fb952fbfe782713c888ca0ab55c41f19
Content-Transfer-Encoding: base64
Content-Type: text/plain;
 name=&quot;TestFile1.txt&quot;;
Content-Disposition: attachment;
 filename=&quot;TestFile1.txt&quot;;

Q29udGVudHMgb2YgVGVzdEZpbGUxLnR4dAo=
--=_fb952fbfe782713c888ca0ab55c41f19--
&quot;

But (intermittently) the message has the same boundary strings for both levels of encoding like this:
&quot;
MIME-Version: 1.0
From: MY_EMAIL_ADDRESS
Subject: Test message: Thu, 15 Nov 07 14:31:12 -0500
Content-Type: multipart/mixed;
        boundary=&quot;=_25b8085bab879c9b936de3ad92f5bee3&quot;


--=_25b8085bab879c9b936de3ad92f5bee3
Content-Type: multipart/alternative;
        boundary=&quot;=_25b8085bab879c9b936de3ad92f5bee3&quot;


--=_25b8085bab879c9b936de3ad92f5bee3--

--=_25b8085bab879c9b936de3ad92f5bee3
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=&quot;ISO-8859-1&quot;

This is the plaintext body.
--=_25b8085bab879c9b936de3ad92f5bee3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=&quot;ISO-8859-1&quot;

&lt;b&gt;This is the HTML body.&lt;/b&gt;
--=_25b8085bab879c9b936de3ad92f5bee3--
&quot;

Removing the call to srand() (in the line prior) stops this intermittent and problematic behavior:
//srand((double)microtime()*1000000);

And the PHP manual says that since PHP 4.2.0, srand() no longer needs to be called prior to rand() as rand() now automatically seeds the generator.</pre>]]></description>
      <dc:date>2009-03-23T17:00:08+00:00</dc:date>
      <dc:creator>jonlogic &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12429">
      <title>Mail_Mime: Bug 12429 [Open] Attachments with long files names are causing difficulty</title>
      <link>http://pear.php.net/bugs/12429</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by erdqwjw
2007-11-12T08:33:58+00:00
PHP: 5.2.2 OS: Apple OSX 10.4.10 Package Version: 1.5.2

Description:
------------
Hi,
Â Â 
Attachments with long files names are causing difficulty 
with a wide range of receiving MUAs.
Â 
// $fname = $caseDir . &quot;/&quot; . $shortfname;
// $dotpos = strrpos($realname, &quot;.&quot;);
// $ext = strtolower(substr($realname,$dotpos+1));
Â 
// $mime-&gt;addAttachment($fname,$mime_types[$ext],$realname);
Â 
It seems that because I am using base64 encoding mail_mime 
is deciding to limit the whole of the mime part's data to 64 
chars per line, incuding the mime part's header. Header 
attributes are also separated by lines.
Â 
This causes problems with someÂ MUAs which loose track of the 
attachment's file extension, and (even though it has a mime-
type) decide they don't know what to do with it and default 
to text.
Â 
Here is a Mail_Mime 1.5.2 excerpt:
Â 
--=_ca502c3561ab4710bb5472d957a3e454
Content-Transfer-Encoding: base64
Content-Type: application/pdf;
name*0=&quot;UH and xxxxx Group Plc Mutually Disclosing XUHO 0609 
09 11 2007.&quot;
name*1=&quot;pdf&quot;;
Content-Disposition: attachment;
filename*0=&quot;UH and xxxxx Group Plc Mutually Disclosing XUHO 
0609 09 11 2&quot;
filename*1=&quot;007.pdf&quot;;
Â 
JVBERi0xLjIKNCAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIK
L1Jlc291cmNlczw8
Â 
Â 
The Apple mail client does something similar:
Â 
--Apple-Mail-1--340428939
Content-Transfer-Encoding: base64
Content-Type: application/pdf;
x-unix-mode=0644;
name=UH and xxxxx Group Plc Mutually Disclosing XUHO 0609 09 
11 2007.pdf
Content-Disposition: inline;
filename*0=&quot;UH and xxxxx Group Plc Mutually Disclosing XUHO 
0609 09 11 2007.&quot;;
filename*1=pdf
Â 
JVBERi0xLjIKNCAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIK
L1Jlc291cmNlczw8
Â 
However, Eudora on Windows XP does this:
Â 
--=====================_-1519325078==_
Content-Type: application/octet-stream; name=&quot;UH and xxxxx 
Group Plc Mutually Disclosing XUHO 0609 09 11 2007.pdf&quot;
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=&quot;UH and xxxxx 
Group Plc Mutually Disclosing XUHO 0609 09 11 2007.pdf&quot;
Â 
JVBERi0xLjIKNCAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIK
L1Jlc291cmNlczw8
Â 
In this case the mime part's header lines are not broken at 
64 chars. All the header attributes appear on one line. The 
filename appears unbroken, and there don't appear to be any 
problems with the receiving MUAs.
Â 
Examples in RFC2046 - whilst not dealing with long filenames 
- seem to adopt this way of doing things. Whilst RFC2047 
talks about a 75 char limit on 'encoded-words' in headers I 
am not sure these are encoded words. 
Â 
Not sure if this is a bug, but it seemsÂ MUAs have difficulty 
dealing with multiline headers and/or split attribute 
values.
Â 
Are their any plans to address this issue?
------------------------------------------------
Â 
BillÂ Worthington
Â 
Dr. W J Worthington
STRI - the Science and Technology Research Institute
University of Hertfordshire
PO Box 109, College LaneÂ 
Hatfield
Hertfordshire
AL10 9AB
T: +44 (0)1707 286077
F: +44 (0)1707 286079
E: mailto:W.J.Worthington@herts.ac.uk
W:Â www.i10.org.uk/bill_worthington</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by erdqwjw
2007-11-12T08:33:58+00:00
PHP: 5.2.2 OS: Apple OSX 10.4.10 Package Version: 1.5.2

Description:
------------
Hi,
Â Â 
Attachments with long files names are causing difficulty 
with a wide range of receiving MUAs.
Â 
// $fname = $caseDir . &quot;/&quot; . $shortfname;
// $dotpos = strrpos($realname, &quot;.&quot;);
// $ext = strtolower(substr($realname,$dotpos+1));
Â 
// $mime-&gt;addAttachment($fname,$mime_types[$ext],$realname);
Â 
It seems that because I am using base64 encoding mail_mime 
is deciding to limit the whole of the mime part's data to 64 
chars per line, incuding the mime part's header. Header 
attributes are also separated by lines.
Â 
This causes problems with someÂ MUAs which loose track of the 
attachment's file extension, and (even though it has a mime-
type) decide they don't know what to do with it and default 
to text.
Â 
Here is a Mail_Mime 1.5.2 excerpt:
Â 
--=_ca502c3561ab4710bb5472d957a3e454
Content-Transfer-Encoding: base64
Content-Type: application/pdf;
name*0=&quot;UH and xxxxx Group Plc Mutually Disclosing XUHO 0609 
09 11 2007.&quot;
name*1=&quot;pdf&quot;;
Content-Disposition: attachment;
filename*0=&quot;UH and xxxxx Group Plc Mutually Disclosing XUHO 
0609 09 11 2&quot;
filename*1=&quot;007.pdf&quot;;
Â 
JVBERi0xLjIKNCAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIK
L1Jlc291cmNlczw8
Â 
Â 
The Apple mail client does something similar:
Â 
--Apple-Mail-1--340428939
Content-Transfer-Encoding: base64
Content-Type: application/pdf;
x-unix-mode=0644;
name=UH and xxxxx Group Plc Mutually Disclosing XUHO 0609 09 
11 2007.pdf
Content-Disposition: inline;
filename*0=&quot;UH and xxxxx Group Plc Mutually Disclosing XUHO 
0609 09 11 2007.&quot;;
filename*1=pdf
Â 
JVBERi0xLjIKNCAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIK
L1Jlc291cmNlczw8
Â 
However, Eudora on Windows XP does this:
Â 
--=====================_-1519325078==_
Content-Type: application/octet-stream; name=&quot;UH and xxxxx 
Group Plc Mutually Disclosing XUHO 0609 09 11 2007.pdf&quot;
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=&quot;UH and xxxxx 
Group Plc Mutually Disclosing XUHO 0609 09 11 2007.pdf&quot;
Â 
JVBERi0xLjIKNCAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIK
L1Jlc291cmNlczw8
Â 
In this case the mime part's header lines are not broken at 
64 chars. All the header attributes appear on one line. The 
filename appears unbroken, and there don't appear to be any 
problems with the receiving MUAs.
Â 
Examples in RFC2046 - whilst not dealing with long filenames 
- seem to adopt this way of doing things. Whilst RFC2047 
talks about a 75 char limit on 'encoded-words' in headers I 
am not sure these are encoded words. 
Â 
Not sure if this is a bug, but it seemsÂ MUAs have difficulty 
dealing with multiline headers and/or split attribute 
values.
Â 
Are their any plans to address this issue?
------------------------------------------------
Â 
BillÂ Worthington
Â 
Dr. W J Worthington
STRI - the Science and Technology Research Institute
University of Hertfordshire
PO Box 109, College LaneÂ 
Hatfield
Hertfordshire
AL10 9AB
T: +44 (0)1707 286077
F: +44 (0)1707 286079
E: mailto:W.J.Worthington@herts.ac.uk
W:Â www.i10.org.uk/bill_worthington</pre>]]></description>
      <dc:date>2007-11-19T05:44:59+00:00</dc:date>
      <dc:creator>w &amp;#x64;&amp;#111;&amp;#x74; j &amp;#x64;&amp;#111;&amp;#x74; worthington &amp;#x61;&amp;#116; herts &amp;#x64;&amp;#111;&amp;#x74; ac &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12411">
      <title>Mail_Mime: Feature/Change Request 12411 [Open] Support RFC 2047 standard for non-ascii characters as attachment filename.</title>
      <link>http://pear.php.net/bugs/12411</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by bmdevelopment
2007-11-09T02:58:32+00:00
PHP: 5.2.4 OS: FreeBSD 6.2-RELEASE #0 Package Version: 1.5.2

Description:
------------
Currently when you attach a filename with non-ascii characters, such as Japanese, the name of the file itself is encoded according to the format in RFC 2231. This is the newer preferred format and works with email clients such as Thunderbird. However, email clients, such as Outlook and Outlook Express, do not support the newer RFC 2231, but only the older, deprecated RFC 2047.

Due to most clients using Outlook and Express, I had to add this support so that they were able to receive attachments with Japanese filenames.

I realize that RFC 2047 is old and basically no good, but I could not rely on MS to update Outlook anytime soon. So, I am submitting this patch to add RFC 2047 support. Hopefully, it can be used and reviewed by others.

The change basically adds another parameter to the addAttachment function that should either be '2047' or '2231' (default). This parameter is kept and eventually passed through to the _buildHeaderParam function in mimePart.php. Here, if the standard is 2047 I encode the filename accordingly. I've taken most of the code for converting to 2047 from _encodeHeaders function in mime.php and made slight modifications.

I think that is about it. This patch is working fine for me now. Please feel free to use, correct and improve it and add it to the code base if necessary. 



Test script:
---------------
&lt;?php
include('Mail.php');
include('Mail/mime.php');

$text = 'Text version of email. ÆeÆLÆXÆg ÆoÂ[ÆWÆâ¡Æâ âÃºâ{ÅÃª';
$html = '&lt;html&gt;&lt;body&gt;HTML version of email. HTML ÆoÂ[ÆWÆâ¡Æâ âÃºâ{ÅÃª&lt;/body&gt;&lt;/html&gt;';
$file = 'test,test,test,test,test,test,ÆeÆXÆg,âÃâÂ·âÃ,âÃºâ{ÅÃª';
$crlf = &quot;\n&quot;;
$hdrs = array( 'From' =&gt; 'test@test.com', 'Subject' =&gt; 'ÆeÆXÆg â°ÃâÃ¨');

$mime = new Mail_mime($crlf);

$mime-&gt;setTXTBody($text);
$mime-&gt;setHTMLBody($html);
$mime-&gt;addAttachment($file, 'text/plain', 'âYâ¢Â2047.csv', false, 'base64', 'attachment', 'UTF-8', '', '', '2047');
$mime-&gt;addAttachment($file, 'text/plain', 'âYâ¢Â2231.csv', false, 'base64', 'attachment', 'UTF-8', '', '', '2231');
$mime-&gt;addAttachment($file, 'text/plain', 'âYâ¢Â____.csv', false, 'base64', 'attachment', 'UTF-8');

$params['head_encoding'] = 'base64';
$params['text_encoding'] = 'base64';
$params['html_encoding'] = 'base64';
$params['head_charset'] = 'UTF-8';
$params['text_charset'] = 'UTF-8';
$params['html_charset'] = 'UTF-8';
//do not ever try to call these lines in reverse order
$body = $mime-&gt;get($params);
$hdrs = $mime-&gt;headers($hdrs);

$mail =&amp; Mail::factory('mail');
$mail-&gt;send('ktanaka@bluemetrix.com', $hdrs, $body);
?&gt;


Expected result:
----------------
The test script contains Japanese characters inline and is encoded in UTF-8. Hopefully, the characters are not destroyed when submitting.

Using the test, you can send yourself a mail with attachments having Japanese filenames - one filename using 2047 and two using 2231. As you will notice, Outlook and Outlook Express will not correctly display the filenames in the 2231 format, which is currently the only format supported in Mail_mime.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by bmdevelopment
2007-11-09T02:58:32+00:00
PHP: 5.2.4 OS: FreeBSD 6.2-RELEASE #0 Package Version: 1.5.2

Description:
------------
Currently when you attach a filename with non-ascii characters, such as Japanese, the name of the file itself is encoded according to the format in RFC 2231. This is the newer preferred format and works with email clients such as Thunderbird. However, email clients, such as Outlook and Outlook Express, do not support the newer RFC 2231, but only the older, deprecated RFC 2047.

Due to most clients using Outlook and Express, I had to add this support so that they were able to receive attachments with Japanese filenames.

I realize that RFC 2047 is old and basically no good, but I could not rely on MS to update Outlook anytime soon. So, I am submitting this patch to add RFC 2047 support. Hopefully, it can be used and reviewed by others.

The change basically adds another parameter to the addAttachment function that should either be '2047' or '2231' (default). This parameter is kept and eventually passed through to the _buildHeaderParam function in mimePart.php. Here, if the standard is 2047 I encode the filename accordingly. I've taken most of the code for converting to 2047 from _encodeHeaders function in mime.php and made slight modifications.

I think that is about it. This patch is working fine for me now. Please feel free to use, correct and improve it and add it to the code base if necessary. 



Test script:
---------------
&lt;?php
include('Mail.php');
include('Mail/mime.php');

$text = 'Text version of email. ÆeÆLÆXÆg ÆoÂ[ÆWÆâ¡Æâ âÃºâ{ÅÃª';
$html = '&lt;html&gt;&lt;body&gt;HTML version of email. HTML ÆoÂ[ÆWÆâ¡Æâ âÃºâ{ÅÃª&lt;/body&gt;&lt;/html&gt;';
$file = 'test,test,test,test,test,test,ÆeÆXÆg,âÃâÂ·âÃ,âÃºâ{ÅÃª';
$crlf = &quot;\n&quot;;
$hdrs = array( 'From' =&gt; 'test@test.com', 'Subject' =&gt; 'ÆeÆXÆg â°ÃâÃ¨');

$mime = new Mail_mime($crlf);

$mime-&gt;setTXTBody($text);
$mime-&gt;setHTMLBody($html);
$mime-&gt;addAttachment($file, 'text/plain', 'âYâ¢Â2047.csv', false, 'base64', 'attachment', 'UTF-8', '', '', '2047');
$mime-&gt;addAttachment($file, 'text/plain', 'âYâ¢Â2231.csv', false, 'base64', 'attachment', 'UTF-8', '', '', '2231');
$mime-&gt;addAttachment($file, 'text/plain', 'âYâ¢Â____.csv', false, 'base64', 'attachment', 'UTF-8');

$params['head_encoding'] = 'base64';
$params['text_encoding'] = 'base64';
$params['html_encoding'] = 'base64';
$params['head_charset'] = 'UTF-8';
$params['text_charset'] = 'UTF-8';
$params['html_charset'] = 'UTF-8';
//do not ever try to call these lines in reverse order
$body = $mime-&gt;get($params);
$hdrs = $mime-&gt;headers($hdrs);

$mail =&amp; Mail::factory('mail');
$mail-&gt;send('ktanaka@bluemetrix.com', $hdrs, $body);
?&gt;


Expected result:
----------------
The test script contains Japanese characters inline and is encoded in UTF-8. Hopefully, the characters are not destroyed when submitting.

Using the test, you can send yourself a mail with attachments having Japanese filenames - one filename using 2047 and two using 2231. As you will notice, Outlook and Outlook Express will not correctly display the filenames in the 2231 format, which is currently the only format supported in Mail_mime.</pre>]]></description>
      <dc:date>2007-11-09T03:16:44+00:00</dc:date>
      <dc:creator>bmdevelopment &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12216">
      <title>Mail_Mime: Bug 12216 [Verified] Incorrect Mail_mime::headers() behaviour (russian text, utf8)</title>
      <link>http://pear.php.net/bugs/12216</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by chewie
2007-10-10T06:36:31+00:00
PHP: 5.2.4 OS: linux Package Version: 1.5.2

Description:
------------
Hello, 
I have an script which sends emails with Mail/mime.php.

I need to send mails with russian text and russian subject in utf8.
When I am trying to pass array with headers (it contains subject), in the result I am getting empty value for subject,
but when I am working with english text in utf8, it shows value normally.

Test script:
---------------
&lt;?php

$crlf = &quot;\n&quot;;
$mimeObject = new Mail_mime($crlf);

$hdrs = array(
	'Subject' =&gt; '&amp;#1056;&amp;#1077;&amp;#1075;&amp;#1080;&amp;#1089;&amp;#1090;&amp;#1088;&amp;#1072;&amp;#1094;&amp;#1080;&amp;#1103;'
);

var_dump($hdrs);

$hdrs = $mimeObject-&gt;headers($hdrs);

var_dump($hdrs);

?&gt;


Expected result:
----------------
array
  'MIME-Version' =&gt; string '1.0' 
  'Subject' =&gt; string '&amp;#1056;&amp;#1077;&amp;#1075;&amp;#1080;&amp;#1089;&amp;#1090;&amp;#1088;&amp;#1072;&amp;#1094;&amp;#1080;&amp;#1103;'
  'Content-Transfer-Encoding' =&gt; string 'quoted-printable' 
  'Content-Type' =&gt; string 'text/html; charset=&quot;utf8&quot;' 


Actual result:
--------------
array
  'MIME-Version' =&gt; string '1.0' 
  'Subject' =&gt; string '' 
  'Content-Transfer-Encoding' =&gt; string 'quoted-printable' 
  'Content-Type' =&gt; string 'text/html; charset=&quot;utf8&quot;'</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by chewie
2007-10-10T06:36:31+00:00
PHP: 5.2.4 OS: linux Package Version: 1.5.2

Description:
------------
Hello, 
I have an script which sends emails with Mail/mime.php.

I need to send mails with russian text and russian subject in utf8.
When I am trying to pass array with headers (it contains subject), in the result I am getting empty value for subject,
but when I am working with english text in utf8, it shows value normally.

Test script:
---------------
&lt;?php

$crlf = &quot;\n&quot;;
$mimeObject = new Mail_mime($crlf);

$hdrs = array(
	'Subject' =&gt; '&amp;#1056;&amp;#1077;&amp;#1075;&amp;#1080;&amp;#1089;&amp;#1090;&amp;#1088;&amp;#1072;&amp;#1094;&amp;#1080;&amp;#1103;'
);

var_dump($hdrs);

$hdrs = $mimeObject-&gt;headers($hdrs);

var_dump($hdrs);

?&gt;


Expected result:
----------------
array
  'MIME-Version' =&gt; string '1.0' 
  'Subject' =&gt; string '&amp;#1056;&amp;#1077;&amp;#1075;&amp;#1080;&amp;#1089;&amp;#1090;&amp;#1088;&amp;#1072;&amp;#1094;&amp;#1080;&amp;#1103;'
  'Content-Transfer-Encoding' =&gt; string 'quoted-printable' 
  'Content-Type' =&gt; string 'text/html; charset=&quot;utf8&quot;' 


Actual result:
--------------
array
  'MIME-Version' =&gt; string '1.0' 
  'Subject' =&gt; string '' 
  'Content-Transfer-Encoding' =&gt; string 'quoted-printable' 
  'Content-Type' =&gt; string 'text/html; charset=&quot;utf8&quot;'</pre>]]></description>
      <dc:date>2009-08-25T07:05:41+00:00</dc:date>
      <dc:creator>kg &amp;#x61;&amp;#116; pingwincheg &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11238">
      <title>Mail_Mime: Bug 11238 [Analyzed] From address encoding</title>
      <link>http://pear.php.net/bugs/11238</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by cederstrom
2007-06-06T08:34:00+00:00
PHP: 5.2.1 OS: FreeBSD Package Version: 1.4.0

Description:
------------
When the From name contain a danish char Ã¦,Ã¸ or Ã¥, then the sending fails with the error &quot;Validation failed for: =?ISO-8859-1?Q?Test=F...&quot;

If I change the 'From'=&gt;&quot;TestÃ¸ TestÃ¥ &lt;me@example.com&gt;&quot; into 'From'=&gt;&quot;Test Test &lt;me@example.com&gt;&quot; it works fine.

Also if I change it into 'From'=&gt;&quot;TestÃ¸ TestÃ¥&quot;, and add the &quot;&lt;me@example.com&gt;&quot; after the $mime-&gt;headers(..) line it also works fine.

The error was not in version 1.36.

Test script:
---------------
&lt;?
	include('Mail.php');
	include('Mail/mime.php');

	$crlf = &quot;\n&quot;;
	$hdrs = array( 'From'    =&gt; &quot;TestÃ¸ TestÃ¥ &lt;me@example.com&gt;&quot;,	'Subject' =&gt; &quot;Example&quot;);
	$mime = new Mail_mime($crlf);
	$mime-&gt;setTXTBody(&quot;Very short email!&quot;);

	//do not ever try to call these lines in reverse order
	$body = $mime-&gt;get();
	$hdrs = $mime-&gt;headers($hdrs);

	$mail =&amp; Mail::factory('mail');
	$err = $mail-&gt;send(&quot;lasse@novicell.dk&quot;, $hdrs, $body);
	print_r($err);
?&gt;


Expected result:
----------------
The mail to be sent.

Actual result:
--------------
PEAR_Error Object - containing a validation error.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by cederstrom
2007-06-06T08:34:00+00:00
PHP: 5.2.1 OS: FreeBSD Package Version: 1.4.0

Description:
------------
When the From name contain a danish char Ã¦,Ã¸ or Ã¥, then the sending fails with the error &quot;Validation failed for: =?ISO-8859-1?Q?Test=F...&quot;

If I change the 'From'=&gt;&quot;TestÃ¸ TestÃ¥ &lt;me@example.com&gt;&quot; into 'From'=&gt;&quot;Test Test &lt;me@example.com&gt;&quot; it works fine.

Also if I change it into 'From'=&gt;&quot;TestÃ¸ TestÃ¥&quot;, and add the &quot;&lt;me@example.com&gt;&quot; after the $mime-&gt;headers(..) line it also works fine.

The error was not in version 1.36.

Test script:
---------------
&lt;?
	include('Mail.php');
	include('Mail/mime.php');

	$crlf = &quot;\n&quot;;
	$hdrs = array( 'From'    =&gt; &quot;TestÃ¸ TestÃ¥ &lt;me@example.com&gt;&quot;,	'Subject' =&gt; &quot;Example&quot;);
	$mime = new Mail_mime($crlf);
	$mime-&gt;setTXTBody(&quot;Very short email!&quot;);

	//do not ever try to call these lines in reverse order
	$body = $mime-&gt;get();
	$hdrs = $mime-&gt;headers($hdrs);

	$mail =&amp; Mail::factory('mail');
	$err = $mail-&gt;send(&quot;lasse@novicell.dk&quot;, $hdrs, $body);
	print_r($err);
?&gt;


Expected result:
----------------
The mail to be sent.

Actual result:
--------------
PEAR_Error Object - containing a validation error.</pre>]]></description>
      <dc:date>2008-12-27T13:05:06+00:00</dc:date>
      <dc:creator>lasse &amp;#x61;&amp;#116; novicell &amp;#x64;&amp;#111;&amp;#x74; dk</dc:creator>
      <dc:subject>Mail_Mime Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10884">
      <title>Mail_Mime: Feature/Change Request 10884 [Assigned] Provide easy way to set build params</title>
      <link>http://pear.php.net/bugs/10884</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by cipri
2007-04-29T07:06:37+00:00
PHP: 5.1.6 OS: Fedora Core 6 Package Version: 1.4.0RC4

Description:
------------
Mail_Mime should provide an easy way to set the build parameters.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by cipri
2007-04-29T07:06:37+00:00
PHP: 5.1.6 OS: Fedora Core 6 Package Version: 1.4.0RC4

Description:
------------
Mail_Mime should provide an easy way to set the build parameters.</pre>]]></description>
      <dc:date>2007-06-21T14:30:22+00:00</dc:date>
      <dc:creator>cipri &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10438">
      <title>Mail_Mime: Feature/Change Request 10438 [Assigned] function for encoding of given string</title>
      <link>http://pear.php.net/bugs/10438</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by fantomas
2007-03-21T05:15:03+00:00
PHP: 4.4.4 OS: any Package Version: 1.3.1

Description:
------------
Hello, it would be nice to provide a simple function that would mime-encoded string from provided string, charset and encoding.
There are many PHP scripts which already do their job, but they send mails with invalid MIME headers, and rewriting them to create mail using object interface of this package would be  too much work.
Providing simple function to encode provided string would help  coders very much to make their mail RFC compliant and not tagged as spam due to invalid header encoding.
The function could look like

Mime_Encode(string[, encoding[, charset]])

where encoding would be auto (smallest result) quoted-printable or base64, and charset could be detected from current locale settings.</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by fantomas
2007-03-21T05:15:03+00:00
PHP: 4.4.4 OS: any Package Version: 1.3.1

Description:
------------
Hello, it would be nice to provide a simple function that would mime-encoded string from provided string, charset and encoding.
There are many PHP scripts which already do their job, but they send mails with invalid MIME headers, and rewriting them to create mail using object interface of this package would be  too much work.
Providing simple function to encode provided string would help  coders very much to make their mail RFC compliant and not tagged as spam due to invalid header encoding.
The function could look like

Mime_Encode(string[, encoding[, charset]])

where encoding would be auto (smallest result) quoted-printable or base64, and charset could be detected from current locale settings.</pre>]]></description>
      <dc:date>2007-05-25T17:19:37+00:00</dc:date>
      <dc:creator>uhlar &amp;#x61;&amp;#116; fantomas &amp;#x64;&amp;#111;&amp;#x74; sk</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/3729">
      <title>Mail_Mime: Feature/Change Request 3729 [Verified] Support for signed messages</title>
      <link>http://pear.php.net/bugs/3729</link>
      <content:encoded><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by xolphin
2005-03-07T07:17:53+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
I added support for signed messages using openssl_pkcs7_sign. Unfortunatly you have to use temporary files when working with openssl_pkcs7_sign. If anybody else has a better solution I would like to hear it.

An encryption routine can be made the same way like this, if you need any help, please let me know. I don't know if this is the right package for encryption and signing of messages, but I thought it would be the most logical.

Reproduce code:
---------------
Changed code:
  http://www.xolphin.net/mime.diff

Example use:
($Customer and $PDFDocument are a DataObjects)

$header['To'] = $Customer-&gt;Email;
$header['From'] = 'test@example.com'; 
$header['Subject'] = 'Signed message';

$mime = new Mail_mime(&quot;\n&quot;);
$mime-&gt;setTXTBody($Customer-&gt;Message);
do
{
  $mime-&gt;addAttachment($PDFDocument-&gt;PDF, 'application/pdf', 'Document ' . $PDFDocument-&gt;DocumentName, 'base64' );  
}
while ($PDFDocument-&gt;Fetch());

$sign_directory = '/var/www/admin/certificates/mail';

if ($filename_signed = $mime-&gt;getSignedMessage(
   $header, 'certificate.pem', 'instantssl.pem',
   $sign_directory, 'password'))
  {
    exec(ini_get('sendmail_path') . ' &lt; ' . $filename_signed);
  }</pre>]]></content:encoded>
      <description><![CDATA[<pre>Mail_Mime Feature/Change Request
Reported by xolphin
2005-03-07T07:17:53+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 

Description:
------------
I added support for signed messages using openssl_pkcs7_sign. Unfortunatly you have to use temporary files when working with openssl_pkcs7_sign. If anybody else has a better solution I would like to hear it.

An encryption routine can be made the same way like this, if you need any help, please let me know. I don't know if this is the right package for encryption and signing of messages, but I thought it would be the most logical.

Reproduce code:
---------------
Changed code:
  http://www.xolphin.net/mime.diff

Example use:
($Customer and $PDFDocument are a DataObjects)

$header['To'] = $Customer-&gt;Email;
$header['From'] = 'test@example.com'; 
$header['Subject'] = 'Signed message';

$mime = new Mail_mime(&quot;\n&quot;);
$mime-&gt;setTXTBody($Customer-&gt;Message);
do
{
  $mime-&gt;addAttachment($PDFDocument-&gt;PDF, 'application/pdf', 'Document ' . $PDFDocument-&gt;DocumentName, 'base64' );  
}
while ($PDFDocument-&gt;Fetch());

$sign_directory = '/var/www/admin/certificates/mail';

if ($filename_signed = $mime-&gt;getSignedMessage(
   $header, 'certificate.pem', 'instantssl.pem',
   $sign_directory, 'password'))
  {
    exec(ini_get('sendmail_path') . ' &lt; ' . $filename_signed);
  }</pre>]]></description>
      <dc:date>2008-03-22T22:15:52+00:00</dc:date>
      <dc:creator>maarten &amp;#x61;&amp;#116; xolphin &amp;#x64;&amp;#111;&amp;#x74; nl</dc:creator>
      <dc:subject>Mail_Mime Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
