There were several posts to the arachne listserv about mail filters that
move messages containing a particular string to a specific directory or
file.  Dev Anand Teelucksingh wrote such a filter (dfilter) that works
when each message is in a separate file. He used a version of grep and
some batch files.

Reflecting on using ``grep'' for filtering mail, I thought it might be
useful to mention a class of freeware dos programs that are variations
on Unix find or grep, or dos find:  These programs find fines based on
filename, filemask, or a string inside the files -- and then execute
a command of your choice on the files thus found.

These programs make it a lot easier to filter files or messages,
since you do not need separate commands to do the copying or
moving. An example of such a program is a versatile ``ultimate'' file
finder called snif written quite some time ago in 1992:

        ftp://ftp.simtel.net/pub/simtelnet/msdos/dirutl/snif134.zip

It allows you to apply different options and commands to different
types of files, on the same command line. One can approximate a mail
filter like dfilter, with a single command like:
        snif C:\inbox\*.msg +ifilename <ENTER>
where ``filename'' contains filter commands like these:
                +xmove %f directory1
                +gReply To: List1
                -x
                +xmove %f directory2
                +gReply To: List2
                -x
                +xmove %f directory3
                +gReply To: List3

This command reads all files in the c:\inbox directory with the extension
``msg'' and moves each file to a different directory, depending on
whether it contains the text, ``Reply To: List1'' ``Reply To: List2''
or ``Reply To: List3''. Filename can also contain complexities like
``ored'' criteria, deletion of some finds (spam filter), etc.

A simpler version of grep is also little known, and does not reside on
the usual ftp sites:

        http://enteract.com/~bobzim/www/bzgrep22.zip

Written by Bob Zimmerman who also wrote a nifty version for win3.1, it
is a version of grep that executes a user command (EX=command %f) on
the files it finds. Unlike snif, bzgrep can look for a pattern using
regular expressions.

Finally, 2 programs that come with the Yarn offline news/mail reader
can be used as standalone programs to filter messages, when these
messages are combined in one file. However, the message headers must
be in one of three formats: unix mailbox, rnews, or soup.  Given this
limitation, the programs import, and filter1 provide a nice interface
for filtering messages. They can also process one file per message.
I and others have found the filter program a bit unreliable when processing
large files.

To unsubscribe from SURVPC send a message to [EMAIL PROTECTED] with 
unsubscribe SURVPC in the body of the message.
Also, trim this footer from any quoted replies.

Reply via email to