6.0.0-alpha14
6/29/25

[#8346] $conf['mailformat']['brokenrfc2231'] doesnt work, bug in Part.php
Summary $conf['mailformat']['brokenrfc2231'] doesnt work, bug in Part.php
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester harakiri_23 (at) yahoo (dot) com
Created 06/15/2009 (5858 days ago)
Due
Updated 06/17/2009 (5856 days ago)
Assigned 06/16/2009 (5857 days ago)
Resolved 06/17/2009 (5856 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/17/2009 07:49:58 PM Michael Slusarz Comment #3
State ⇒ Resolved
Reply to this comment
Fixed in FW_3.  This was fixed in Horde 4 previously due to the MIME rewrite.
06/16/2009 01:00:56 PM Jan Schneider Assigned to Michael Slusarz
State ⇒ Assigned
 
06/15/2009 08:54:11 AM harakiri_23 (at) yahoo (dot) com Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ $conf['mailformat']['brokenrfc2231'] doesnt work, bug in Part.php
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
The workaround for the option brokenrfc2231 doesnt work, for longer 
filenames at least (>50?).



The check (strpos($encode_2231, '*=') !== false)) will never return 
true, simply because



$encode_2231 = MIME::encodeRFC2231($key, $value, $charset);



will not result in *= but in *0= *1= etc - an encoded string looks like this:



name*0="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

     
name*1="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

     
name*2="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

     name*3="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.pdf"



there is no name*= for longer filenames. Only for shorter



Fix:



replace if with



if (!empty($GLOBALS['conf']['mailformat']['brokenrfc2231']) &&

                 ((strpos($encode_2231, '*=') !== false) || 
(strpos($encode_2231, '*0=') !== false))) {

                 $ctype .= '; ' . $key . '="' . MIME::encode($value, 
$charset) . '"';

             }



in both places

Saved Queries