<?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/12429/bug">
    <title>PEAR Bug #12429</title>
    <link>http://pear.php.net/bugs/12429</link>
    <description>[Open] Attachments with long files names are causing difficulty</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/bugs/12429"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/12429/2007-11-19+05%3A44%3A59#2007-11-19+05%3A44%3A59"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/12429/2007-11-18+14%3A26%3A07#2007-11-18+14%3A26%3A07"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/12429/2007-11-17+03%3A10%3A55#2007-11-17+03%3A10%3A55"/>
     </rdf:Seq>
    </items>
  </channel>
    <item rdf:about="http://pear.php.net/bugs/12429">
      <title>erdqwjw</title>
      <link>http://pear.php.net/bugs/12429</link>
      <description><![CDATA[<pre>Mail_Mime Bug
Reported by erdqwjw
2007-11-12T13: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>
      <content:encoded><![CDATA[<pre>Mail_Mime Bug
Reported by erdqwjw
2007-11-12T13: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>
      <dc:date>2007-11-12T13:33:58-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/12429/2007-11-19+05%3A44%3A59#2007-11-19+05%3A44%3A59">
      <title>erdqwjw [2007-11-19 10:44]</title>
      <link>http://pear.php.net/bugs/12429#1195469099</link>
      <description><![CDATA[<pre>Thanks for the patch. I will apply it and see how I get on.

Bill Worthington</pre>]]></description>
      <content:encoded><![CDATA[<pre>Thanks for the patch. I will apply it and see how I get on.

Bill Worthington</pre>]]></content:encoded>
      <dc:date>2007-11-19T10:44:59-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/12429/2007-11-18+14%3A26%3A07#2007-11-18+14%3A26%3A07">
      <title>cwiedmann [2007-11-18 19:26]</title>
      <link>http://pear.php.net/bugs/12429#1195413967</link>
      <description><![CDATA[<pre>&gt; BTW: The initial patch from Request #12411 does
&gt; not work for you.

I have rewritten this patch. Now this should also work for you.

Regards,
Carsten</pre>]]></description>
      <content:encoded><![CDATA[<pre>&gt; BTW: The initial patch from Request #12411 does
&gt; not work for you.

I have rewritten this patch. Now this should also work for you.

Regards,
Carsten</pre>]]></content:encoded>
      <dc:date>2007-11-18T19:26:07-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/12429/2007-11-17+03%3A10%3A55#2007-11-17+03%3A10%3A55">
      <title>cwiedmann [2007-11-17 08:10]</title>
      <link>http://pear.php.net/bugs/12429#1195287055</link>
      <description><![CDATA[<pre>&gt; Attachments with long files names are causing
&gt; difficulty with a wide range of receiving MUAs.

For example Outlook and Outlook Express.


&gt; Not sure if this is a bug, but it seems MUAs have
&gt; difficulty dealing with multiline headers and/or
&gt; split attribute values.

IMHO it's more a feature request and it's similar to Request #12411: Disabling the extensions from RFC 2231.

BTW: The initial patch from Request #12411 does not work for you.

Regards,
Carsten</pre>]]></description>
      <content:encoded><![CDATA[<pre>&gt; Attachments with long files names are causing
&gt; difficulty with a wide range of receiving MUAs.

For example Outlook and Outlook Express.


&gt; Not sure if this is a bug, but it seems MUAs have
&gt; difficulty dealing with multiline headers and/or
&gt; split attribute values.

IMHO it's more a feature request and it's similar to Request #12411: Disabling the extensions from RFC 2231.

BTW: The initial patch from Request #12411 does not work for you.

Regards,
Carsten</pre>]]></content:encoded>
      <dc:date>2007-11-17T08:10:55-00:00</dc:date>
    </item>
</rdf:RDF>