« Return to Thread: Messages generated by html_mail have wrong MIME headers

Messages generated by html_mail have wrong MIME headers

by Alexandros Vellis :: Rate this Message:

Reply to Author | View in Thread

I have an issue with messages generated by html_mail version 2.3-1.4 in
my Squirrelmail installation.

Let's take a multipart HTML mail generated by thunderbird. Part of the
MIME body looks like this:


This is a multi-part message in MIME format.
--------------050607020808030102030902
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

UTF-8 Test: āĂěĚĎěĨģ * ДЈДВЍЌЁѴѭѬѧѩѪѫ* /ελληνικά/!!! :-)


This is the corresponding message generated by html_mail:


------=_20090731125348_90194
Content-Type: multipart/alternative;
 boundary="4237fsu_trap_49109_84352113709002_=----"
Content-Transfer-Encoding: utf-8


Obviously, the charset shouldn't be where the Content-Transfer-Encoding
is (which should be 8-bit), and charset is absent.

As a result, these messages, when being replied-to or forwarded
inside Squirrelmail itself, lose a lot of the characters, which are
replaced with questionmarks. That's because this snippet of
compose.php is executed, with $actual = 'us-ascii' instead of 'utf-8':

 // charset encoding in compose form stuff

if (isset($body_part_entity->header->parameters['charset'])) {
     $actual = $body_part_entity->header->parameters['charset'];
} else {
    $actual = 'us-ascii';
}

if ( $actual && is_conversion_safe($actual) && $actual !=
            $default_charset){

        $bodypart =
        charset_convert($actual,$bodypart,$default_charset,false);
}


--
Alexandros Vellis
National & Kapodistrian University of Athens
Network Operations Centre


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
-----
squirrelmail-plugins mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-plugins@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins

signature.asc (204 bytes) Download Attachment

 « Return to Thread: Messages generated by html_mail have wrong MIME headers