* Ricardo SIGNES <[EMAIL PROTECTED]> [2008-06-26T13:37:09]
> Demonstration attached.

Thanks, ezmlm.  Here it is:

use strict;

use MIME::Parser;
# my $entity = MIME::Parser->new->parse_open('bizarre.msg');
my $entity = MIME::Parser->new->parse(\*DATA);

sub cleanup_mime {
  my ($entity) = @_;
  foreach my $part ($entity->parts) {
    cleanup_mime($part);
    $entity->parts([]);
  }
}

cleanup_mime($entity);
$entity->make_singlepart;

print $entity->as_string;
__DATA__
Received: from indigo.pobox.com (indigo.pobox.com [207.106.133.17])
        by chiclet.listbox.com (Postfix) with ESMTP id 2AE91214A41
        for <[EMAIL PROTECTED]>; Tue, 24 Jun 2008 01:22:44 -0400 (EDT)
Received: from vip-2fed93075f2 (unknown [116.60.133.101])
        by indigo.pobox.com (Postfix) with SMTP id 4DE1A6BF4D;
        Tue, 24 Jun 2008 01:22:30 -0400 (EDT)
From: "ÕÅÏÈÉú"<ÕÅÏÈÉú>
Reply-To: "[EMAIL PROTECTED]"<[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED]"<[EMAIL PROTECTED]>
Subject: =?gb2312?B?uePW3crQwaq3or34s/a/2sOz0tfT0M/euavLvg==?=
Date: Tue, 24 Jun 08 13:22:18 +0800
MIME-Version: 1.0
Content-type: multipart/related;
    type="multipart/alternative";
    boundary="----=_NextPart_000_0015_1963AAAC.4C2B0004"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-Id: <[EMAIL PROTECTED]>


This is a multi-part message in MIME format.

------=_NextPart_000_0015_1963AAAC.4C2B0004
Content-Type: multipart/alternative;
        boundary="----=_NextPart_001_0016_1963AAAC.4C2B0004"


------=_NextPart_001_0016_1963AAAC.4C2B0004
Content-Type: text/html; charset=gb2312
Content-Transfer-Encoding: base64

PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwvL0VO
Ij4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgY29udGVudD1odHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29t
L2ludGVsbGlzZW5zZS9pZTUgDQpuYW1lPXZzX3RhcmdldFNjaGVtYT4NCjxNRVRBIGh0dHAtZXF1aXY9
Q29udGVudC1UeXBlIGNvbnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD1nYjIzMTIiPg0KPE1FVEEgY29u
dGVudD0iTVNIVE1MIDYuMDAuMjkwMC4zMzU0IiBuYW1lPUdFTkVSQVRPUj48L0hFQUQ+DQo8Qk9EWSBz
dHlsZT0iRk9OVC1TSVpFOiA5cHQ7IEZPTlQtRkFNSUxZOiDLzszlIj4NCjxQPsT6usMhPEJSPiZuYnNw
OyZuYnNwOyCxvrmry77XqMPFzqq498Oz0tfJzLvyyfqy+rOnvNK0+sDtu/XO7734s/a/2rGoudihoiAN
CsnMvOyhorWl1qShosjrstahorGoudjK1tD4oaLNz7O1oaLW0LjbLLT6sOy499bWsvq12NakyukuwarP
tcjLo7rVxc/Iyfogyta7+jEzNjMyMjc4MzMyJm5ic3A7IFRFTDAyMC0zNzIzMjYwNiANCjYxMDMwOTY0
IEZBWDAyMC02MTAzMDUxNSC12Na3o7q549bdytDM7LrTx/jR4MHrwrcxMjC6xb3w0eC088/DIMjn09C0
8sjFx+u8+8HCITxCUj48L1A+PC9CT0RZPjwvSFRNTD4NCg==


------=_NextPart_001_0016_1963AAAC.4C2B0004--



------=_NextPart_000_0015_1963AAAC.4C2B0004--


Reply via email to