Using the following script (wrote it in 10 mins Whoohoo!) we were able to extract all the messages, including bodyparts, and send them to our customers:
Edited by dws to add <code> tags#!/usr/local/bin/perl -w use strict; $| = 1; my @Message; my $MsgId; my $Found; my $Number=0; while(<>) { if (/^Return-Path:/) { $Found=0; push @Message, $_; while(<>) { push @Message,$_; last if (($Found==1)&&(/^--$MsgId\S*--/)); if ((/internal id (\S+);/)&&($Found==0)) { $MsgId=$1; $Found=1; }; }; open FILE,">good/$MsgId.$Number.msg" or die "Error writing to $MsgId +.msg\n"; print FILE @Message; close FILE; @Message=""; $Number++; }; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Dead.lettered
by Simplicus (Monk) on Apr 20, 2000 at 20:45 UTC |