# decode the possibly encoded body, either # from MIME-multipart message or from message body $body = unpack_mail_body($mail); # body is HTML # Check the HTML for bad dtds etc. $part_reason .= "wrong inline dtd\n" if $body =~ m#<\s*!\s*[a-z]{1,5}\s*>#mg > 5; $part_reason .= check_bogus_html_tags($body);