[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Easy way to cut body of email in perl
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.