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.

Reply via email to