Altho I applaud for using Perl to solve this one, if the mailserver had an MTA-linked virusscanner installed (there are quite a few out there;
MIMESweeper's comes to mind), there wouldn't be a problem :| I do know that for some smaller companies, purchasing AV software for their MTA can be quite expensive, but there are cheap/free ones too.
Again, ++ for using Perl :)
Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.