[Rt-commit] r19647 - rt/3.8/branches/forward-message-encoding/lib/RT

falcone at bestpractical.com falcone at bestpractical.com
Tue May 12 18:10:47 EDT 2009


Author: falcone
Date: Tue May 12 18:10:46 2009
New Revision: 19647

Modified:
   rt/3.8/branches/forward-message-encoding/lib/RT/Attachment_Overlay.pm   (contents, props changed)

Log:
 r19580:  elacour | 2009-05-07 06:49:19 -0400
 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/branches/forward-message-encoding/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/3.8/branches/forward-message-encoding/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/3.8/branches/forward-message-encoding/lib/RT/Attachment_Overlay.pm	Tue May 12 18:10:46 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