[Rt-commit] r19580 - rt/3.8/trunk/lib/RT

elacour at bestpractical.com elacour at bestpractical.com
Thu May 7 06:50:30 EDT 2009


Author: elacour
Date: Thu May  7 06:49:19 2009
New Revision: 19580

Modified:
   rt/3.8/trunk/lib/RT/Attachment_Overlay.pm   (contents, props changed)

Log:
Fix display problem with non ascii headers in forwarded emails.

We forward OriginalContent, which uses OriginalEncoding, but we forward Headers
for this content as recorded by RT i.e. always using UTF-8. If content is text
and uses different encoding than UTF-8, display in MUA is broken.
So this patch encode headers as RFC 2047 to make sure MUA can read them.

Modified: rt/3.8/trunk/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Attachment_Overlay.pm	Thu May  7 06:49:19 2009
@@ -457,8 +457,12 @@
     my $self = shift;
 
     my $entity = new MIME::Entity;
-    $entity->head->add( split /:/, $_, 2 )
-        foreach $self->SplitHeaders;
+    foreach my $header ($self->SplitHeaders) {
+        my ($h_key, $h_val) = split /:/, $header, 2;
+	# We need to encode header as RFC 2047, to avoid conflict with
+	# OrignalContent Encoding that may break display
+        $entity->head->add( $h_key, Encode::encode('MIME-Header', $h_val ) );
+    }
 
     use MIME::Body;
     $entity->bodyhandle(


More information about the Rt-commit mailing list