procmail
[Top] [All Lists]

Re: Filtering .EXE files

2001-07-11 17:19:26
At 15:26 2001-07-11 +0200, Luis Sepulveda H did say:

:0 B
* .*filename=.*.exe
/home/lsepulve/exes/
:0 B
* .*filename=.*.EXE
/home/lsepulve/EXES/

Why two forms (and two target dirs)? The match operations are by default case insensitive.

But the problem is that when the filename is like "execpcional.doc" or "EXECUTION.txt", the filter assume that is a .exe file, and then also filter the file, and these is not good!..

You should check the list archives for messages in the past few months which discuss attachment filtering in detail. Even after fixing the syntax error, your filter is WAY to broad. Note that THESE messages discussing the rule will trip it up, unless you filter procmail messages out before this rule.

Does somebody know how I have to compose the lines in procmailrc file for not filter that kind of files?

Escape the DOT before EXE:

* filename=.*\.EXE


Without that escape, the dot is merely a single character wildcard. When you escape it, it becomes an actual DOT.

Also, you don't need the .* at the beginning of the regexp -- unless you specifiy "^" at the beginning, the match isn't anchored to the beginning of a line, and will match anywhere within the line.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>