[Mimedefang] survey: dropping password protected file

Michal Jankowski Michal.Jankowski at fuw.edu.pl
Wed Mar 3 19:26:17 EST 2004


"Paul Murphy" <pmurphy at ionixpharma.com> writes:

>         if ($zip->read($path) == AZ_OK) {
>            ...
>         }

There is a room for improvement here. 8-)

First, in case of an error in processing an archive, Archive::Zip
routines are printing some error messages and call traces by default.
We don't want them.

Second, we should do something in case of error.

So, a better version:
-----------------------------------------------------------------------------
        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();
        }
-----------------------------------------------------------------------------

  MJ



More information about the MIMEDefang mailing list