BTW, we could implement all of this AND, OR, NOT functionality currently by

1. Assigning a unique power of 2 weight to every test (e.g. 1, 2, 4, 8, 16,
32, ...)
2. Setting up weightmatch and/or weightrange tests to perform an action for
each desired combination (e.g. weightmatch on a weight of 9 to perform a
unique action on tests that weight 1 and 8, but not 2, 4, 16, 32, ...).

Note that this would work by WARNing, HOLDing, DELETEing, etc. on
combinations of tests rather than a weight threshold, so using a weight of
10 to hold and weight of 15 or 20 to delete would no longer work.  Instead,
you would set an action for each combination that you wanted to take an
action on...basically a subset of 1... (2^N)-1 for N unique tests.

It would probably work best to use lower numbers for less reliable tests to
allow for weightrange actions on high aggregate weights.

It could be a pain to set up and manage, but it would meet all of the AND,
NOT, OR criteria right now.

Darin.


----- Original Message ----- 
From: "Matt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 19, 2004 12:42 PM
Subject: Re: [Declude.JunkMail] Combination tests (AND/OR/NOT)


R. Scott Perry wrote:

> They run as individual tests.  There isn't any built-in way to combine
> tests logically (AND/OR/NOT).  The latest beta does let you do an OR
> with filters (for example, a test that will be triggered if either the
> NOPOSTMASTER or NOABUSE test or both fail), using TESTSFAILED.  But I
> don't believe there is a way to do AND currently.


Since this would be of great utility to us, let me make a suggestion as
to how to implement this.  There are multiple ways that this could be
done, however there is one way that would best suit all such needs and
be the most universal, and that would be done using boolean logic and
operators like so:

SPAMCOP and ((SORBS-SPAM or XBL or FIVETEN-SPAM) and NOT  CREDIT-FILTER)

This would mean that NOT would be a reserved name for a filter file, and
you test names shouldn't use parenthesis, but of course you could use a
curly brace or brackets instead of parenthesis since they're less
common, otherwise you could allow parenthesis if you first checked for
if the test name existing before you parsed the operators as shown above.

I suppose that this could be done within the Global.cfg with columns
added for weights, but that isn't going to be the best way to do it
because we need the ability to order this for processing within the
custom filter chain.  Therefore, I would recommend creating the ability
to add new test definitions on the fly within custom filters like so:

TESTDEF               MYTEST   SPAMCOP and (SORBS-SPAM or XBL or
FIVETEN-SPAM) and NOT (CREDIT-FILTER)

You could place that anywhere within a custom filter and then
immediately do tests for it like so.


TESTDEF               MYTEST   SPAMCOP and (SORBS-SPAM or XBL or
FIVETEN-SPAM) and NOT (CREDIT-FILTER)
TESTSFAILED      10              CONTAINS      MYTEST


I'm not saying that it couldn't be implemented another way, however some
of my own immediate ideas had limitations as to how and where this could
be used.  The more limiting ways of doing this would be to either define
the combo tests within the Global.cfg (because of ordering), or defining
combo tests in a single custom file (again because of ordering).  This
way you could for instance have a filter that could fail it's self and
then kick off a totally different test under certain conditions like so:

----- Global.cfg -----
COMBO-ZOMBIE        filter
C:\IMail\Declude\Filters\Combo-Zombie.txt        x      0      0


----- Combo-Zombie.txt -----
REVDNS       END      ENDSWITH      mx.aol.com
REVDNS       END      ENDSWITH      mail.comcast.net
REVDNS       END      CONTAINS      gateway

REVDNS        0    ENDSWITH    .aol.com
REVDNS        0    ENDSWITH    .comcast.net
REVDNS        0    ENDSWITH    .cable.rogers.com
REVDNS        0    ENDSWITH    .bredband.skanova.com
REVDNS        0    ENDSWITH    .cable.mindspring.com
REVDNS        0    ENDSWITH    .cgocable.ca

TESTDEF               ZOMBIE                     SPAMCOP and COMBO-ZOMBIE

TESTSFAILED      10      CONTAINS      ZOMBIE


The only caveat is that people would need to keep in mind that the test
name within the Global.cfg shouldn't be used for a TESTDEF name, unless
you want to work around that and allow things to be redefined on the fly
(more work, but would protect from error conditions).

What do you think?


Matt

-- 
=====================================================
MailPure custom filters for Declude JunkMail Pro.
http://www.mailpure.com/software/
=====================================================


---
[This E-mail was scanned for viruses by Declude Virus
(http://www.declude.com)]

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.

_____________________________________
[This E-mail virus scanned by 4C Web]


---
[This E-mail was scanned for viruses by Declude Virus (http://www.declude.com)]

---
This E-mail came from the Declude.JunkMail mailing list.  To
unsubscribe, just send an E-mail to [EMAIL PROTECTED], and
type "unsubscribe Declude.JunkMail".  The archives can be found
at http://www.mail-archive.com.

Reply via email to