[Mimedefang] mimedefang filter > filter file names < ??

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Wed Aug 6 03:48:01 EDT 2003


On Tue, 5 Aug 2003, Troy R. LeBouef wrote:

man perlre

> Well this is what I did ... Not working though ??
> >>>    $re = '\.' . $bad_exts . $bad_files . '\.*([^-A-Za-z0-9_.,]|$)';
               ^a dot
                      ^ then one of the bad extensions
                                  ^ then one of the bad filenames
                                               ^ then zero or more dots
etc.pp

It cannot work, as I understand your intention.

I guess mean something like:

$bad_files = '(files\.zip|message\.zip)';
$re = "(\\.$bad_exts|^$bad_files)" . '\.*([^-A-Za-z0-9_.,]|$)';
        ^^^^^^^^^^^^matching the bad extensions as before
                     ^^^^^^^^^^^or matching bad files from
beginning of the passed in filename

BTW: $bad_files must be properly quoted, delimited by the alternation
operator (|) and surrounded by parentheses.
Bye,

-- 
Steffen Kaiser



More information about the MIMEDefang mailing list