Re: qmail file filter
From: ___cliff rayman___ (cliff@genwax.com)Date: 10/10/01
- Previous message: Sanjeev B.S.: "LPD configuration +"
- In reply to: Andrew Blogg: "RE: qmail file filter"
- Next in thread: Charlie Brady: "Re: qmail file filter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Message-ID: <3BC37893.4475B189@spamless.genwax.com> Date: Tue, 09 Oct 2001 15:22:11 -0700 From: ___cliff rayman___ <cliff@genwax.com> To: Andrew Blogg <apblogg@bigpond.net.au> Subject: Re: qmail file filter
Andrew Blogg wrote:
> ---snip---
>
> sub extcheck
> {
local $_;
chomp; #remove end of line on our local copy
# there may need to be some more cleanup here to
# make sure we have the filename and the filename only
>
> /.*.[Vv][Bb][Ss]/ && errormsg;
> /.*.[Cc][Oo][Mm]/ && errormsg;
> /.*.[Ee][Xx][Ee]/ && errormsg;
> /.*.[Cc][Hh][Mm]/ && errormsg;
> /.*.[Ss][Cc][Rr]/ && errormsg;
> /.*.[Hh][Tt][Aa]/ && errormsg;
> /.*.[Vv][Bb][Ee]/ && errormsg;
> /.*.[Ss][Hh][Ss]/ && errormsg;
> /.*.[Bb][Aa][Tt]/ && errormsg;
> };
i think these should be in the form of /.*\.vbs$/i && errormsg;
the \. means a period and not just any character
the $ at the end anchors the pattern at the end
the /i modifier is not that important, just clearer, since you do not have to
give an alternation for each character.
the regex's that you are using cause any filename that has at least
one character followed by any of those three characters to get a warning
message. so a filename of "welcome.gif" would get a warning message
because of the 'com' preceded by at least one character in the name.
-- ___cliff rayman___cliff@genwax.com___http://www.genwax.com/
- Previous message: Sanjeev B.S.: "LPD configuration +"
- In reply to: Andrew Blogg: "RE: qmail file filter"
- Next in thread: Charlie Brady: "Re: qmail file filter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|