procmail
[Top] [All Lists]

RE: Logging and file grepping

2004-04-14 20:55:55
:0 B:  # <---- colon for lockfile!
     * your body conditions

I thought setting the lockfile was only for forwarding emails?

Yes.  First suggestion: don't re-invent the wheel.  Use my Virus
Snaggers(tm), 
which is at ver. 1.6.1 officially but for which ver. 2.0.0 really is on
the
cusp of being released.
Or use one of the other similar packages that people will talk about here
(go
to the list archives and search for "virus", "netsky", etc).  Read about
mine
and some others on Nancy's QuickStart pages:
http://www.ii.com/internet/robots/procmail/qs/#viruses

Thanks for the tip, I'm not trying to reinvent the wheel; im trying to learn
:) And there are quite a few virus mods, don't know which one to go for. I
guess I could try them all. But that's another story.

As far as your specific question, though, first you should quote your
$MATCH
($\MATCH); and then try something like this:

  * ? egrep -wis -e "$\MATCH" $LIST/netsky_attach

Yeah, the above doesn't work. I tried a few different things but couldn't
figure it out. At the top of the netsky_attach file, I have test.*\.txt but
it did not filter any attachments like [test3.txt]. I've included that
section of the logfile

procmail: Assigning "MATCH="
procmail: Matched "test3.txt"
procmail: Match on "filename="\/.*[^"]+"
procmail: Executing
"egrep,-wis,-e,()test3\.txt,/usr/local/etc/spamlist/netskyd_attach"
procmail: Non-zero exitcode (1) from "egrep"
procmail: No match on "egrep -wis -e ()test3\.txt
/usr/local/etc/spamlist/netskyd_attach"

if you really want regexes in there.  I recommend using fgrep and dumping
the
regex idea in that list, though.
In that case, don't quote $MATCH:

  yours * ? fgrep -wis -e "$MATCH" $LIST/netsky_attach
    mine *? fgrep -I $MATCH $LIST/netsky_attach

With the exception of the w, s, and e option the above is pretty much what I
have now. No? I wouldn't say the "-s" is needed only because not to many (if
any) filenames have spaces. The reason I wanted the regexes is so that I
don't have to have
test1.txt
test2.txt
And so on. So it thought have a regex of test.*\.txt would cover it. I could
be wrong, and it may require more resources. I don't know which way would be
better, comparing resources and speed.

About the "LOG", I only want it to make the entry when it matches the
"netsky_attach" and not the "netsky_subject". Is there a way to do this.

The second is something I use a couple of places.  I have not tested the
egrep
one at all.

Thanks,
Dan


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