procmail
[Top] [All Lists]

Re: Searchhing for words in external word list?

2008-12-11 07:42:42
On Thu, 11 Dec 2008, Dave Wood wrote:

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

I haven't actually tried this; but I think you would need to tackle the problem in reverse - since you don't know what any specific "BADWORD" is/

:0
* ^Subject:[    ]\/*
| for WORD in `cat badwords.txt`; do fgrep -i $WORD $MATCH; done

Then allow anything with "Non-zero exitcode (1) from " /bin/fgrep" to pass and trash any hits.

On the other hand, have you considered that spammers use things like:
\/i(_at_)gr@, ci al is, etc. in their subjects? If you try to put every possible permutation of every "bad word" in a list - it's gonna get large quickly.

                                - fleet -

____________________________________________________________
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