[Mimedefang] Archive::Zip problem?

Lucas Albers admin at cs.montana.edu
Thu Mar 4 16:05:12 EST 2004


Cormack, Ken said:
>> Archive::Zip likes to spew backtraces to STDERR when it's reading a
>> malformed zip file.  Michal Jankowski suggested calling
>> setErrorHandler() with a dummy subroutine to cause these to be ignored:
> http://lists.roaringpenguin.com/pipermail/mimedefang/2004-March/020650.html

I currently call it like such:
  use Archive::Zip qw(:ERROR_CODES);
        my $zip = Archive::Zip->new();
        if ($zip->read($path) == AZ_OK) {


Should I define both ERROR_CODE and this item as mentioned:
How to do so?

Via Michal Jankowski Michal.Jankowski at fuw.edu.pl:
sub dummy {};
        Archive::Zip::setErrorHandler(\&dummy);
        if ($zip->read($path) == AZ_OK) {
            ...
        } else {
# do something with broken .zip files (eg. discard)
#          action_quarantine_entire_message("broken zip");
           md_graphdefang_log('bad_file', 'broken zip', $RelayAddr);
           action_discard();
        }

-- 
Luke Computer Science System Administrator
Security Administrator,College of Engineering
Montana State University-Bozeman,Montana



More information about the MIMEDefang mailing list