David Reta wrote:
> I would like to remove certain named zip files from emails
> but I don't wan't to discard all zip files since we use them.
> I tried to add the whole filename to bad_exts but this does
> not work. Is there somewhere else in the filter I can add
> this or do I need to add my own code to the re_match function.
> 

You need to add your own code.  Here's a sample (untested)
sub filter_bad_filename ($) {
    my($entity) = @_;
    my($bad_exts, $re);

    my @badfilenames =
        (       "price.zip",
                "the-price.zip",
                "snowhite.scr",
        )

    for my $badfilename (@badfilenames)
    {    if (lc $badfilename eq $entity)
         {    return 1;
         }
    }

    # Bad extensions
    $bad_exts = '(ade|adp|app|asd|asf|asx|bas|bat|chm|cmd|com|cpl|crt|dl
l|exe|fxp|hlp|hta|html?|hto|inf|ini|ins|isp|jse?|lib|lnk|mdb|mde|msc|msi
|msp|mst
|ocx|pcd|pif|prg|reg|scr|sct|sh|shb|shs|sys|url|vb|vbe|vbs|vcs|vxd|wmd|w
ms|wmz|w
sc|wsf|wsh|\{[^\}]+\})';

    # Do not allow:
    # - CLSIDs  {foobarbaz}
    # - bad extensions (possibly with trailing dots) at end or
    #   followed by non-alphanum
    $re = '\.' . $bad_exts . '\.*([^-A-Za-z0-9_.,]|$)';
    return re_match($entity, $re);
}

[EMAIL PROTECTED]                      805.964.4554 x902
Hispanic Business Inc./HireDiversity.com         Software Engineer
perl -e"map{y/a-z/l-za-k/;print}shift" "Jjhi pcdiwtg Ptga wprztg,"

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to