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]
>
> A
This breaks down for many messages that have 2 "From"'s. Most messages start with a
From not followed by a colon that is the envelope leader and include a From: (notice
followed by a colon) that is in the message headers.
I would suggest you not reinvent the wheel and check out the many modules
Here is a start. I put to an array, but you could write to a file:
#!perl -w
my @MyMail = ();# hold email
my $MyHoldMail = '';# use to build each email msg
my $In = 0; # count of lines
my $MyProc = 0; # ready to process or not
while ( ) {