On Wed, Apr 14, 2004 at 02:09:13AM -0400, Daniel wrote:
I have the following recipe:
#NetSky
:0
* ? fgrep -xi "$MYSUBJECT" $LIST/netsky_subject
{
LOG="Virus NetSky
"
:0B
* filename="\/.*[^"]+
* ? fgrep -xi $MATCH $LIST/netsky_attach
$TRASH
}
What I want it to do is only if the email matches the file name with the
file "netsky_attach" will procmail log "Virus Netsky". I can't put
"LOG=Virus Netsky" on the action line. It tried putting the mail to it.
How would I make a log entry only if it matches within "netsky_attach"?
:0
* conditions
{
LOG = "your message"
:0 B: # <---- colon for lockfile!
* your body conditions
$TRASH
}
Second I would also like "netsky_attach" to be sort of an extended regex.
For instance and filenames with document[0..9].pif will be deleted. I tried
frep -e, -E but neither have worked. Any suggestions?
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
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
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:
* ? fgrep -wis -e "$MATCH" $LIST/netsky_attach
The second is something I use a couple of places. I have
not tested the egrep one at all.
--
dman
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail