Subject: | Unable to strip the attached message |
Hi,
The attached zipped file contains a KAV (Kaspersky AntiVirus) report email. I have stripped the virus body from that zip in order to produce a smaller file and to prevent virus spreading (the problem below is not affected from the the stripping).
The problem is that a script which uses Email-MIME-Attachment-Stripper (ver 1.2) could not extract the attachment, although ($mm->attachments == 1). ($mm->message->as_string) and ($mm->message->body_raw) are OK.
########### .... ###########
my $mail_message = Email::Abstract->cast($rfc822, "Email::MIME");
my $mm = Email::MIME::Attachment::Stripper->new( $mail_message );
my $has_attach = $mm->attachments; -----------------> 1
for my $ddd ($mm->attachments){
$filename = $ddd->{'filename'}; ------------> "", OK
$content_type = $ddd->{'content_type'}; ----> "message/rfc822", OK
$payload = $ddd->{'payload'};
$fsize = length($ddd->{'payload'}); --------> 0, BAD
}
########### .... ###########
Slackware 9.1.0 (2.4.26)
perl, v5.8.0 built for i486-linux