Marcelo wrote:
>
> Hi everybody ...
Hello,
> When I receive mail.. I can see it like a plain text file under
> /var/spool/mail/marcelo where all the messages are concateneted one
> after the other .... here is an example :
>
> From [EMAIL PROTECTED] Fri Dec 6 17:56:19 2002
>
> [snip]
>
> Another e-mail body ...
>
> I have a script that take the headers of one message ... but it doesn't
> works with this file when there are more than one file concateneted ..so
> I need to split the message into n parts where each part is a single
> message based in the word "From " that starts every mesage in this file
> ....How???...
#!/usr/bin/perl -w
use strict;
use Mail::Util qw(read_mbox);
my @messages = read_mbox '/var/spool/mail/marcelo';
for my $num ( 0 .. $#messages ) {
print 'Message Number: ', $num + 1, "\n";
print @{$messages[$num]};
}
__END__
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]