procmail
[Top] [All Lists]

Re: Searchhing for words in external word list?

2008-12-11 05:09:23
On (09:35 11/12/08), Dave Wood <dave(_at_)unrealize(_dot_)co(_dot_)uk> put 
forth the proposition:
I would like to know if it's possible to search for words contained in an
external file. Something like:

BADWORDS=`cat $HOME/.badwords`

:0
* ^Subject:.*${BADWORDS}*
spam

This doesn't work and I'm guesing that it's looking for a match of all the
output of cat rather than checking each word.

Solved I think. I separated each word with | so my word file looks like
word1|word2|word3 Then used [ ] in the test:

:0
* ^Subject:.*[${BADWORDS}]*
spam

Seems to work now but need more testing.


This is the idea anyway. If anyone has some suggestions on how to do it
that would be great.

Cheers

-- 
How doth the little crocodile
      Improve his shining tail,
And pour the waters of the Nile
      On every golden scale!

How cheerfully he seems to grin,
      How neatly spreads his claws,
And welcomes little fishes in,
      With gently smiling jaws!
              -- Lewis Carrol, "Alice in Wonderland"

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

-- 
Remember:  Silly is a state of Mind, Stupid is a way of Life.
                -- Dave Butler

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail