On Sat, 1 May 2021, Henrik K wrote:
On Fri, Apr 30, 2021 at 10:58:09PM +0300, Henrik K wrote:
On Fri, Apr 30, 2021 at 09:36:00PM +0300, Henrik K wrote:
On Fri, Apr 30, 2021 at 11:30:37AM -0700, John Hardin wrote:
Generating a RE fragment that would match on any of the extracted to/cc
header email addresses would probably be fairly easy as part of this. But
how would we incorporate that fragment in rules?
Probably impossible to implement for normal regex rules, because they are
all compiled at start.. it would require modifying them on the fly by
replacing some tag or so.
Designing a plugin for it would be much easier and more versatile..
Ok thinking about it more, Replacetags already has the base functionality..
could extend it a bit more to replace static metadata like To addresses,
which is already parsed and known before any rules run. I'll give it a
try.
Yeah it gets too complicated. The compiled regexes live for all the
duration of the process, which can process many messages. If you change the
regex in later than in config parse stage, then it would require some new
logic to always restore the original regex when a new message is processed,
and yet again replace it.
Rats. A plugin does sound better.
Doing all that for a some static header field data seems very unflexible
too. What if you want to match some other string, maybe something from the
body text? It seems a better solution would be making regex rules able to
capture something, and then you have some rules which would have dependency
on that hitting and use the captured variable.
Yeah, that's something I've been wanting a long time as well.
The need for "rules dependency/chaining" is also already a feature we need,
mentioned for example in
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=6855
Wouldn't be much of a more stretch to add some capture variables in the mix.
Would we be in the same boat, though? When the RE gets compiled, would
that freeze the value of the variable at that time in the RE rather than
interpolating it at execution?
--
John Hardin KA7OHZ http://www.impsec.org/~jhardin/
[email protected] pgpk -a [email protected]
key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
The yardstick you should use when considering whether to support a
given piece of legislation is "what if my worst enemy is chosen to
administer this law?"
-----------------------------------------------------------------------
Today: May Day - Remember 110 million people murdered by Communism