procmail
[Top] [All Lists]

Re: filter based on body keywords?

2005-05-01 16:20:41
hi Ruud,

Thanks for your helpful answers!

Ruud H.G. van Tol wrote the following on 05/02/2005 12:01 AM:
How would it appear if i wanted the keywords in a text file instead?
(each keyword on a newline?) - and i include this text file in the
recipe?

If it is a limited number of words, say less then a hundred,
than make the file look like:

       :0
       * B ?? ()\<(\
WORD[1-3]|\
KEYWORD5|\
BOB|\
(v|\//)[i1l][a(_at_)][g9]r[a@]|\
LAST-BAD-WORD\
                  )\>
       !$MATCH

and call it badwords.rc. It is easy to transform the keywords file
you described into such a recipe-file; a single sed or awk call can
do it.


The recipe then becomes:

     LINEBUF = '12345'
     :0
     * ^TO_\/john(_at_)example\(_dot_)com
     {
       INCLUDERC = 'badwords.rc'
       :0:
       spam
     }


But it is not a good path to go. For instance this very message would
get into that spam mailbox-file, if the keywords are there. And if the body of a
spam message is encoded, and you don't decode it first, the recipe won't find
the keywords. Etc., etc.

Did you try SpamAssassin already?  DNSBL? DCC?

yes, I am already using spamassassin, and it works well. But what i want to achieve here is actually a whitelist! I have some people that will write to some mailbox, and i will give each of them a unique keyword to include in the body of their messages, and if that keyword is not there, the mail is treated as spam :) I will therefore try your example above. So, i will name "badwords.rc" to "goodwords.rc" and "spam" to "the mailbox i want to use". (that mailbox is actually an RT queue, but i hope this doesnt matter)

thanks!
ernest

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>