[Mimedefang] Question about new function in MD 2.40

Cormack, Ken kcormack at acs.roadway.com
Tue Mar 9 13:25:06 EST 2004


Group,

Not being a perl guy (yet), I'm looking through the mimedefang-filter and
mimedefang.pl files, and spotted the recently-added Archive::Zip stuff that
is new to 2.40, and I have a question.

In mimedefang-filter, I see the following, in sub filter_bad_filename:

    # Look inside ZIP files
    if (re_match($entity, '\.zip$') and
        $Features{"Archive::Zip"}) {
        my $bh = $entity->bodyhandle();
        if (defined($bh)) {
            my $path = $bh->path();
            if (defined($path)) {
                return re_match_in_zip_directory($path, $re);
            }
        }
    }

I found the "re_match_in_zip_directory" function in mimedefang.pl, and I'm
wondering if I'm reading the code correctly.  Is the net result of these
changes to simply reject any zip-member file contained within a zip, simply
based on the filename extension of that member file?

I know there was discussion a week or so ago, and in fact, I incorporated
what appears to be a super-set of this stuff into my own filter last week
(specifically, to detect zips containing huge files, and zips that were
encrypted.)

Is my understanding of the new code above, correct?

Thanks, gents, in advance, for helping me grok this stuff.

KEN CORMACK, RHCE
Sr. UNIX Systems Analyst,
    Open Systems Group
Sr. Software Analyst,
    TSG Midrange Systems Group
AFFILIATED COMPUTER SERVICES, INC.

"If that that is 'is' is that that is not 'not is', is that that is 'not is'
that that is not 'is'?  It is!" - Ken Cormack

"Sendmail administration is not black magic.  There are legitimate technical
reasons why it requires the sacrificing of a live chicken." - Unknown



More information about the MIMEDefang mailing list