procmail
[Top] [All Lists]

Re: (il)logical algebra

2004-03-24 17:04:59
Am Do 25.03.04 um 00:41 CET schrieb Dallman Ross <dman(_at_)nomotek(_dot_)com>:

On Thu, Mar 25, 2004 at 12:24:41AM +0100, Stefan Heinrichsen wrote:
For spamfiltering I set the header "X-To-Whitelist" and
"X-Blacklist". I want a mail to be filterd if: both headers are yes,
none of them or only X-Blacklist.

So it would be like
  A | (A & B) | (!A & !B)
= A | (!A & !B) 
= A | !B

So I use the rule
* ^X-Blacklist: Yes | !^X-To-Whitelist: Yes

If I now receive a mail containing none of this both headers I get:
No match on "^X-Blacklist: Yes | !^X-To-Whitelist: Yes"

where is the mistake?

Well, it's easier if we use procmail's natural ANDing of conditions.

First of all, if you see X-Blacklist is set you want to filter, right?


  :0
  * ^X-Blacklist: Yes
  do_something

Otherwise, if X-Blacklist is NOT set, then *only if X-Whitelist
is also unset, do something:

  :0 E  # use the "else" flag if above recipe was nondelivering
  * ! ^X-Whitelist: Yes
  do_something


Well that would work but the do_something is in my case a block of about
40 lines (some additional spamfilters) which are changed frequently. So
it's not could to have it twice in the procmailrc.

mfg
stefan

-- 
begin  LOVE-LETTER-FOR-YOU.txt.vbs end
Gegen Nichtstandardkonforme Software!
http://piology.org/ILOVEYOU-Signature-FAQ.html

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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