[Rt-commit] r19603 - rt/3.8/branches/forward-with-transaction/lib/RT

falcone at bestpractical.com falcone at bestpractical.com
Fri May 8 17:57:57 EDT 2009


Author: falcone
Date: Fri May  8 17:57:57 2009
New Revision: 19603

Modified:
   rt/3.8/branches/forward-with-transaction/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/branches/forward-with-transaction/lib/RT/Attachment_Overlay.pm
==============================================================================
--- rt/3.8/branches/forward-with-transaction/lib/RT/Attachment_Overlay.pm	(original)
+++ rt/3.8/branches/forward-with-transaction/lib/RT/Attachment_Overlay.pm	Fri May  8 17:57:57 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