From: Don Armstrong Date: Thu, 8 Jun 2006 06:29:42 +0000 (-0700) Subject: * Merge in changes from the source tree to fix rfc1522 encoding of X-Git-Tag: release/2.6.0~608^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3b0db793ac4dcfaa83cee5d7d283ad86ce519b62;p=debbugs.git * Merge in changes from the source tree to fix rfc1522 encoding of messages --- diff --git a/Debbugs/MIME.pm b/Debbugs/MIME.pm index 1269e17..9099fa1 100644 --- a/Debbugs/MIME.pm +++ b/Debbugs/MIME.pm @@ -131,7 +131,9 @@ sub create_mime_message{ # Build the message # MIME::Entity is stupid, and doesn't rfc1522 encode its headers, so we do it for it. - my $msg = MIME::Entity->build(map{encode_rfc1522($_)} @{$headers}, + my $msg = MIME::Entity->build('Content-Type' => 'text/plain; charset=utf-8', + 'Encoding' => 'quoted-printable', + (map{encode_rfc1522($_)} @{$headers}), Data => $body ); diff --git a/t/01_mime.t b/t/01_mime.t index acffce9..9a67089 100644 --- a/t/01_mime.t +++ b/t/01_mime.t @@ -1,7 +1,7 @@ # -*- mode: cperl;-*- # $Id: 01_mime.t,v 1.1 2005/08/17 21:46:17 don Exp $ -use Test::More tests => 3; +use Test::More tests => 4; use warnings; use strict; @@ -27,4 +27,16 @@ ok(Debbugs::MIME::decode_rfc1522(q(=?iso-8859-1?Q?D=F6n_Armstr=F3ng?= $test_str, + From => $test_str, + ], + $test_str, + [], + ) !~ m{([\xF0-\xFF]+)}, + "create_mime_message properly encodes 8bit messages." + ); + # XXX figure out how to test parse