6.0.0-beta1
7/4/25

[#6424] Possible bug in lib/Horde/MIME/Structure.php
Summary Possible bug in lib/Horde/MIME/Structure.php
Queue Horde Groupware Webmail Edition
Queue Version 1.0.3
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester tomi.leppikangas (at) gmail (dot) com
Created 03/11/2008 (6324 days ago)
Due
Updated 03/11/2008 (6324 days ago)
Assigned
Resolved 03/11/2008 (6324 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/11/2008 04:14:02 PM Jan Schneider Comment #2
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Nice catch, and thanks for the detailed analysis. That's what a call a 
good bug report!

Fixed in CVS (for HGW 1.1).
03/11/2008 12:39:33 PM tomi (dot) leppikangas (at) gmail (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Possible bug in lib/Horde/MIME/Structure.php
Queue ⇒ Horde Groupware Webmail Edition
Milestone ⇒
Patch ⇒ No
Reply to this comment
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->getPrimaryType() == 'text') &&

-            ($ob->getCharset() == 'us-ascii') &&

+            (String::upper($ob->getCharset()) == 'US-ASCII') &&

              isset($GLOBALS['mime_structure']['default_charset'])) {

              $ob->setCharset($GLOBALS['mime_structure']['default_charset']);

          }


Saved Queries