<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="http://bugs.horde.org/themes/feed-rss.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <title>Possible bug in lib/Horde/MIME/Structure.php</title>
  <pubDate>Sun, 07 Sep 2008 03:55:25 -0400</pubDate>
  <link>http://bugs.horde.org/ticket/6424</link>
  <atom:link rel="self" type="application/rss+xml" title="Possible bug in lib/Horde/MIME/Structure.php" href="http://bugs.horde.org/ticket/6424/rss" />
  <description>Possible bug in lib/Horde/MIME/Structure.php</description>

  
  
  <item>
   <title>I noticed that we have problem with mails without content-ty</title>
   <description>I noticed that we have problem with mails without content-type headers and 8bit characters.
I know that these are not allowed in standards.
We have configured horde/imp to force to use iso-8859-1 for mails without charset. (with 
default_msg_charset in imp/config/prefs.php.)

Even with default charset, mails without charset doesn't show accent chars right. I notised that our imap server gives those mails charset as 'US-ASCII' and horde checks charset as 'us-acii' (lowercase), and does not set it to default charser. I changes test to 'US-ASCII', and broken mails  shows ok now.

So i think that test should uppercase charset first, and then compare. Here is patch for that:


--- ../horde-webmail-1.0.1/lib/Horde/MIME/Structure.php 2007-03-16 21:24:26.000000000 +0200
+++ lib/Horde/MIME/Structure.php        2008-03-11 14:33:48.000000000 +0200
@@ -161,7 +161,7 @@

         /* Set the default character set. */
         if (($ob-&gt;getPrimaryType() == 'text') &amp;&amp;
-            ($ob-&gt;getCharset() == 'us-ascii') &amp;&amp;
+            (String::upper($ob-&gt;getCharset()) == 'US-ASCII') &amp;&amp;
             isset($GLOBALS['mime_structure']['default_charset'])) {
             $ob-&gt;setCharset($GLOBALS['mime_structure']['default_charset']);
         }
</description>
   <pubDate>Tue, 11 Mar 2008 08:39:33 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6424#t43703</link>
  </item>
  <item>
   <title>Nice catch, and thanks for the detailed analysis. That's wha</title>
   <description>Nice catch, and thanks for the detailed analysis. That's what a call a good bug report!
Fixed in CVS (for HGW 1.1).</description>
   <pubDate>Tue, 11 Mar 2008 12:14:02 -0400</pubDate>
   <link>http://bugs.horde.org/ticket/6424#t43713</link>
  </item>
  

 </channel>
</rss>
