procmail
[Top] [All Lists]

Re: Filtering .EXE files

2001-07-11 15:28:43
On 11 Jul, Luis Sepulveda H wrote:
| Hi everybody,
|       I'm new here (and my english is not good), but I gonna try to explain 
myself.
|       Well, I have tried to filter the .EXE files in my sendmail 8.9.3 on 
linux 
| RedHat 6.2, with the follow lines in procmailrc file:
| 
| :0 B
| * .*filename=.*.exe
| /home/lsepulve/exes/
| :0 B
| * .*filename=.*.EXE
| /home/lsepulve/EXES/
| 
|       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!..
|       Does somebody know how I have to compose the lines in procmailrc file 
for 
| not filter  that kind of files?
| 
|       Thanks in advance and sorry for my english.

You're English seems pretty good to me -- better than any of the
non-native languages I can't speak (unless pig latin counts). ;-)

The dot "." has special meaning in regular expressions. It matches any
character. So if you want to match a dot literally it needs to be
backslash escaped like: "* .*filename=.*\.exe". In the examples you
gave, where the string "exe" appears at the beginning of the filename,
I'm not sure what the dot was matching unless there was a space between
the = and the filename or the filename was wrapped in quotes. But I'm
guessing it's either one of those cases, or you gave theoretical
examples and not actual ones.

Lastly, you should have found all of the deliveries going to ~/exes and
none of them going to ~/EXES, given the recipes you posted. Procmail
recipes are case insensitive by default, so anything that would match
the second recipe would have already matched and been delivered by the
first. If you definitely want two different recipes for "exe" and "EXE",
you need to add a "D" flag to each one like: ":0 BD".

-- 
                         /"\
Don Hammond              \ /     ASCII Ribbon Campaign
Raleigh, NC US            X        Against HTML Mail,
                         / \      and News Too

_______________________________________________
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>