<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/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>Fri, 10 Apr 2026 17:02:29 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/6424</link> 
  <atom:link rel="self" type="application/rss+xml" title="Possible bug in lib/Horde/MIME/Structure.php" href="https://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&#039;t show accent chars right. I notised that our imap server gives those mails charset as &#039;US-ASCII&#039; and horde checks charset as &#039;us-acii&#039; (lowercase), and does not set it to default charser. I changes test to &#039;US-ASCII&#039;, 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() == &#039;text&#039;) &amp;&amp;

-            ($ob-&gt;getCharset() == &#039;us-ascii&#039;) &amp;&amp;

+            (String::upper($ob-&gt;getCharset()) == &#039;US-ASCII&#039;) &amp;&amp;

             isset($GLOBALS[&#039;mime_structure&#039;][&#039;default_charset&#039;])) {

             $ob-&gt;setCharset($GLOBALS[&#039;mime_structure&#039;][&#039;default_charset&#039;]);

         }

</description> 
   <pubDate>Tue, 11 Mar 2008 12:39:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6424#t43703</link> 
  </item> 
   
  <item> 
   <title>Nice catch, and thanks for the detailed analysis. That&#039;s wha</title> 
   <description>Nice catch, and thanks for the detailed analysis. That&#039;s what a call a good bug report!

Fixed in CVS (for HGW 1.1).</description> 
   <pubDate>Tue, 11 Mar 2008 16:14:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6424#t43713</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
