21 lines
341 B
Perl
21 lines
341 B
Perl
|
#!/usr/bin/perl
|
||
|
|
||
|
use Email::MIME;
|
||
|
use warnings;
|
||
|
use strict;
|
||
|
|
||
|
unless ($ARGV[0] and -f $ARGV[0]) {
|
||
|
die "pass in the filename of the email as an argument.";
|
||
|
}
|
||
|
|
||
|
open FILE, "<$ARGV[0]";
|
||
|
undef $/;
|
||
|
my $email = <FILE>;
|
||
|
|
||
|
my $parsed = Email::MIME->new($email);
|
||
|
my @parts = $parsed->parts;
|
||
|
foreach my $el (@parts) {
|
||
|
print $el->body;
|
||
|
last;
|
||
|
}
|