procmail
[Top] [All Lists]

Re: filter based on body keywords?

2005-05-01 17:00:12
Ernest Byaruhanga schreef:

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 :)

Yes, of course. I am having a bad headache after a nice day in the 
sun, and was not really paying attention. 

There is one password per From-address I suppose?

  PM_PWLIST = '
pete(_at_)example(_dot_)com:123summer7654
maria(_at_)example(_dot_)com:765buckle4581
'

  # insert Sean's CLEANFROM code here

  :0
  *$ PM_PWLIST ?? ^$\CLEANFROM:\/.+
  {
    PM_CODE = "$MATCH"

    :0:
    *  ^TO_\/john(_at_)example\(_dot_)com
    *  MATCH ?? ^^\/[^(_at_)]+
    *$ B ?? ()\<$\PM_CODE\>
    IN.$MATCH   # will be 'IN.john'

    :0:   # else (& fall-through)
    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".

The spam should stay spam, because procmail stops at delivery.
The first chance of delivery is the line with 'IN.$MATCH'.

-- 
Grtz, Ruud

____________________________________________________________
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>