Ideally rules could be written with some pseudo-language that could do
complex things, grabbing things into variables, modifying, comparing to
other things etc.  Then there wouldn't be any need for Perl plugins doing
some trivial stuff.

An awful lot I think could be done simply by having rules that can capture to named per-message-global variables, and allowing those variables to be used in other (or the same) rules. The Perl RE syntax almost allows for this as-is, so it shouldn't be a great stretch to modify the rules parser to allow such things and capture the names of the variables and create the variables.

Obviously though this gets into complexities of rule dependencies and creates possible circular dependencies. I'd just treat any such as rule errors and let the user worry about it. Usage of undefined (ungenerated) variables could also just be treated as errors. But it would still take evaluating the dependency chains, and that could reorder rule priorities and the like, so it would take some thought.

There should also be some way to simply define variable values without parsing anything. For instance, I have a bunch of rules that are dependent on knowing my email address and the name string I expect in a proper To address, and seeing if the mail is sent to me or the like. On a system that allows user_prefs it would be trivial to have these strings placed there for use by various rules. Currently I have the strings hard-coded in a bunch of different rules, making them unuseful for anyone but me.

Reply via email to