Re: [Evolution] complex boolean like filter rules



You could try using the "expression" filter type.  This takes a
scheme-like s-expression, which you can use to produce arbitrary logic
in a more-or-less straightforward way.

e.g. something like
 (and (or (body-contains "foo" "blah" "frum")
          (header-contains "subject" "ximian" "helixcode"))
      (not (header-contains "subject" "evolution" "redcarpet")))

represents:

(body contains "foo" or "blah" or "frum"  OR subject contains "ximian"
or "helixcode" )
 AND
( NOT ( subject contains "evolution" or "redcarpet" ) )


Most of the *contains rules have an implicit OR by adding more terms in
them.  Although not all of them.  The expression editor isn't really
setup though (you could just create empty ones and edit the xml file
directly in ~/evolution/filters.xml, but it is xml, not a text file).

Check the $prefix/share/evolution/filters.xml  (i think) file for
examples of available commands (just the stuff in ()'s, without the
${abc} stuff which is for substitution).

However, none of it is particularly documented, and the format may
change in the future (e.g. to be real scheme) - although i can't see any
of that happening any time real soon because it is sufficient as it is.

The only other alternative is to use an external program and do the
logic there as a 'pipe to shell command' filter.

If you can design a usable and implementable interface to manage filters
of this complexity, you're welcome to.  We've generally found however,
that having filters too specialised just isn't much use to 99% of the
people out there, and adding an interface to make it possible would
probably be a mess.


On Tue, 2002-12-10 at 20:02, Aristotle wrote:
Hi,

I would like to add complex rules - with if and or type statements but I
can only find where to add a bunch of rules and apply by all being met
or at least one.

Any idea who to make this a little more flexible?

Say to the effect of if (mail containing A or B or C) but NOT (D or E or
F) and so on
-- 
--------------------------------------
Adelaide, South Australia
AIM demosthenes aus Gabber demosthenes
Yahoo IM demosthenes_down_under
ICQ 175117479 PGP(GPG) key ID D408E804
Unreal Tournament 2003 demosthenes
(internode.on.net game servers)
--------------------------------------


_______________________________________________
evolution maillist  -  evolution ximian com
http://lists.ximian.com/mailman/listinfo/evolution





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]