my @parts = $entity->parts;
if (scalar @parts == 0) {
- if (${$entity->{mail_inet_head}{mail_hdr_hash}{'Content-Transfer-Encoding'}[0]} =~ /base64/) {
+ if ($entity->{mail_inet_head}{mail_hdr_hash}{'Content-Transfer-Encoding'} and
+ ${$entity->{mail_inet_head}{mail_hdr_hash}{'Content-Transfer-Encoding'}[0]} =~ /base64/) {
print $entity->{ME_Bodyhandle}{MBS_Data};
} else {
print '<pre>';
} # foreach
} else {
if ($part->mime_type =~ /text/) {
- print '<pre>';
- $part->print_body;
- print '</pre>';
+ my $encoding = ${$part->{mail_inet_head}{mail_hdr_hash}{'Content-Transfer-Encoding'}[0]};
+ if ($encoding =~ /base64/) {
+ $part->bodyhandle->print();
+ } else {
+ print '<pre>';
+ $part->print_body;
+ print '</pre>';
+ } # if
} # if
} # if
} # foreach