[ale] Easy way to cut body of email in perl

Christopher Fowler cfowler at outpostsentinel.com
Wed Jan 4 17:44:49 EST 2006


On Wed, 2006-01-04 at 17:34 -0500, Allan Neal wrote:
> You could pipe it through formail first.  From the man page on
> formail:
> 
>  To extract the body from a message:
>                formail -I ""

That may be the ticket.  I'll have to test it.  I need to grab the from
address from the headers but I could then have formail do the stripping
for me later in the program.

while(<STDIN>) {
  $data .= "$_";
}

# Grab info from headers
open FORMMAIL, "| formail -I \"\" |";
print FORMMAIL $data;
$data = "";
while(<FORMMAIL>) {
  $data .= "$_";
}
close FORMMAIL

That is just an idea above.  I'll have to test it.






More information about the Ale mailing list